简体   繁体   English

wso2 API Manager“不支持的客户端身份验证方法!”

[英]wso2 API Manager “Unsupported Client Authentication Method!”

I am attempting to use the OAuth2 grant_type=password for a token request as described here with the WSO2 API Manager. 我试图使用的OAuth2 grant_type =密码令牌请求作为描述这里与WSO2 API管理器。 Using the following curl command. 使用以下curl命令。

curl -k -d "grant_type=password&username=<uname>&password=<pwd>&scope=PRODUCTION" http://localhost:8280/token

The response from this request is: 该请求的响应为:

{"error":"invalid_request","error_description":"Missing parameters: client_id"}

Next, I supply my consumer key and the curl request becomes the following: 接下来,提供我的使用者密钥,并且curl请求变为以下内容:

curl -k -d "grant_type=password&username=<uname>&password=<pwd>&scope=PRODUCTION&client_id=<myconsumerkey>" http://localhost:8280/token

However, the response is baffling: 但是,响应令人困惑:

{"error":"unsupported_client_authentication_method","error_description":"Unsupported Client Authentication Method!"}

So, my question is does the API Man just not support this grant_type? 所以,我的问题是API Man是否不支持该grant_type? Or, am I doing something incorrectly here? 还是我在这里做错了什么? Should I be looking at the identity server for this grant type? 我应该在身份服务器上查看这种授予类型吗?

Cheers 干杯

You want to send the client credentials (client key and secret) in HTTP Basic Authorization header. 您要在HTTP基本授权标头中发送客户端凭据(客户端密钥和机密)。 Curl command would be such as following. 卷曲命令将如下所示。 Here "--user client-Key:client-Secret" has been used to creates the Basic Authorization header using curl command. 在这里,“-user client-Key:client-Secret”已用于使用curl命令创建基本授权标头。 You can use following command with your values. 您可以将以下命令与值一起使用。

curl --user tFVhXORF35S9TTyeaZIH2IEXEw4a:4h6fq4jgRYKrr4v91A_zQgw4Xtoa -k -d "grant_type=password&username=admin&password=admin" -H "Content-Type: application/x-www-form-urlencoded" https://{IP}:{Port}/oauth2/token curl --user tFVhXORF35S9TTyeaZIH2IEXEw4a:4h6fq4jgRYKrr4v91A_zQgw4Xtoa -k -d“ grant_type = password&username = admin&password = admin” -H“内容类型:application / x-www-form-urlencoded”:https:// { /令牌

Add in to this more, I guess WSO2API does not support to receive client credentials in request body. 除此之外,我猜WSO2API不支持在请求正文中接收客户端凭据。 According to the OAuth 2.0 spec, It is not recommended. 根据OAuth 2.0规范,不建议使用。 Please check here 在这里检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM