经认证的客户端无权使用此授权授予类型

时间:2020-11-06 08:27:01

标签: wso2

我一直在构建一个基于React的SPA,以使用WSO2 API Manager中部署的API。 我做了这个出色的教程中提到的一切: https://wso2.com/blogs/thesource/2019/08/building-a-react-based-single-page-application-to-consume-an-api-deployed-in-wso2-api-manager/

所以我正在使用OAuth2隐式授予类型。 但是,在到达/ authorize请求后,我收到此错误消息:

Object { error: "unauthorized_client", error_description: "The authenticated client is not authorized to use this authorization grant type", session_state: "485a86f974459bfb9cdd7a845341e88bcc4cfedc242cb15cfc2956e131a7c44c.SMRIHTA_L6wA3yqb59iSSA", sp: "admin_ReactApp_PRODUCTION", tenantDomain: "carbon.super" }
Auth.js:26

可能是什么问题? 在我的开发门户界面(https:// localhost:9443 / devportal)中,我注意到除隐式授予类型之外的所有类型。它没有显示在列表中。

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

仅当以下方法返回false时,才会发生上述错误。

https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/master/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/authz/handlers/AbstractResponseTypeHandler.java#L123

因此,唯一的可能性如下。

  1. 该应用未启用隐式授予类型。
  2. 授权请求不包含响应类型为response_type = id_token

1。在开发人员门户中启用隐式授予

在“应用程序”部分。添加您在授权请求中定义的回调URL。然后,隐含的勾将出现,您将能够选择授权。

refer to this image

请重新检查您要从客户端应用程序发起的授权请求。

https://localhost:8243/authorize
scope=openid
&response_type=id_token
&redirect_uri=http://localhost:8080/playground2/oauth2client
&nonce=13e2312637dg136e1
&client_id=mzdQQ0RZOIqAf549ucIImB4h0SIa

如果以上两个都很好。您应该能够解决该错误。

谢谢 Dileepa