我正在尝试使用OAuth2 grant_type = password作为令牌请求,如here与WSO2 API Manager一样。使用下面的curl命令。wso2 API管理器“不支持的客户端身份验证方法!”
curl -k -d "grant_type=password&username=<uname>&password=<pwd>&scope=PRODUCTION" http://localhost:8280/token
从这个请求的响应是:
{"error":"invalid_request","error_description":"Missing parameters: client_id"}
接下来,我提供我的消费键和卷曲的要求变为:
curl -k -d "grant_type=password&username=<uname>&password=<pwd>&scope=PRODUCTION&client_id=<myconsumerkey>" http://localhost:8280/token
然而,反应是莫名其妙:
{"error":"unsupported_client_authentication_method","error_description":"Unsupported Client Authentication Method!"}
所以,我的问题是API Man是否不支持这个grant_type?或者,我在这里做错了什么吗?我应该看看这个授权类型的身份服务器吗?
干杯
谢谢@Asela。在这种情况下,我没有客户端密钥或客户端密钥。因此,我试图使用资源所有者密码授予来检索令牌。我想我看到的唯一选择是使用store api登录,然后检索密钥和秘密,然后生成对api标记的请求。有什么想法吗? –
通常,当您使用资源所有者密码授权类型时,您还需要认证客户端http://tools.ietf.org/html/rfc6749#section-4.3.2基本上,因为您是应用程序开发人员,您必须注册应用程序并从API存储接收客户端凭证。 – Asela