代码之家  ›  专栏  ›  技术社区  ›  Emac

Flask Dance OAuth通过Microsoft Azure错误

  •  0
  • Emac  · 技术社区  · 6 年前

    我正在测试一个Azure web应用程序,它将使用Flask Dance通过用户的Microsoft帐户授权用户。我从Azure的文档中获取了代码:

    blueprint = make_azure_blueprint(
        client_id="id_here",
        client_secret="secret_here")
    
    app.register_blueprint(blueprint, url_prefix="/login")
    
    @app.route('/')
    def login():
        if not azure.authorized:
            return redirect(url_for("azure.login"))
            response = azure.get("/v1.0/me")
        assert resp.ok
        return "You are {mail} on Azure AD".format(mail=resp.json()["userPrincipalName"])
    

    因此,当我运行它时,我会得到登录屏幕,然后登录,但随后会出现以下错误:

    Sorry, but we’re having trouble signing you in.
    
    AADSTS50011: No reply address is registered for the application.
    

    当我部署它时,我收到一个502错误,并且无法连接到它(在我设置Azure蓝图部分之前,它正在工作)。

    我错过了什么,做错了什么?

    在本页上:

    https://platinumdogs.me/2016/04/25/understanding-the-oauth2-redirect_uri-and-azure-ad-reply-url-parameters/

    上面说我应该可以添加一个“登录URL”和一个“App ID URI”,但是我在任何地方都找不到这些字段。

    1 回复  |  直到 6 年前
        1
  •  2
  •   4c74356b41    6 年前

    你应该读一点关于OAuth的东西,你可以开始 here . 至于这个错误,你似乎需要为你的Azure广告应用程序配置回复URL。