This question already has answers here:
getting #error=unsupported_response_type&error_description=AADSTS70005: with token request

(2 个回答)


3年前关闭。




嗨,我正在 Angular 2 中开发 Web 应用程序。我在 webapi 中有 oauth 身份验证。我在前端使用 Angular 2。登录时,我正在调用以下代码。
   private login() {
        this.oauthService.initImplicitFlow();
        this.oauthService.loginUrl = "https://login.microsoftonline.com/d35ba220-6896666-4acc-9899-dc75131c4fba/oauth2/authorize?resource=\"https://graph.windows.net/ \"& response_type=code";
        this.oauthService.redirectUri = "http://localhost:65298";
        this.oauthService.clientId = "<MY_CLIENT_ID>";
        this.oauthService.issuer = "https://login.microsoftonline.com/d35ba220-6749-4acc-578787-dc75131c4fba";
        this.oauthService.oidc = true;
        this.oauthService.setStorage(sessionStorage);
        this.oauthService.tryLogin({});
    }

我得到低于错误。
http://localhost:65298/?error=unsupported_response_type&error_description=AADSTS70005%3a+
The+WS-Federation+sign-in+response+message+contains+an+unsupported+OAuth+parameter+value+in+the+encoded+wctx%3a+%27response_type%27%0d%0aTrace+ID%3a+65dc2592-4ba1-42f6-9f24-eba1c1894900%0d%0aCorrelation+ID%3a+6edaf003-3d26-434b-9b8a-88a267feb350%0d%0aTimestamp%3a+2018-01-17+09%3a09%3a39Z&state=9MnA2eD68aZtOvHSodIjX9IqA1NdSjslrnGaFAlL

有人可以帮我解决这个问题吗?

最佳答案

根据 AAD Auth Failures - Implicit OAuth is not enabled for the application 上的 MSDN 文档,您需要在 Azure 门户的应用程序注册 list 中将 oauth2AllowImplicitFlow 设置为 true
问题
在 AAD 中创建应用注册时,您需要手动编辑应用 list 并将 oauth2AllowImplicitFlow 属性的值设置为 true 。否则 AAD 登录流程将不起作用

解决方案
请按照以下步骤解决此问题。

  • 使用租户中的管理员帐户登录 portal.azure.com
  • 导航到左侧栏中的 Azure Active Directory > 应用程序注册 > 您的应用程序
  • 单击描述您的应用程序的 Pane 顶部的 Manifest
  • 将属性 oauth2AllowImplicitFlow 的值更改为 true 。如果该属性不存在,请添加它并将其值设置为 true
    .net - oauth 中不支持的响应类型-LMLPHP
  • 单击“保存”以保存修改后的 list 。
  • 10-08 03:48