我下载并安装WSOAM 1.10二进制文件,并按照步骤https://docs.wso2.com/display/CLUSTER44x/Clustering+API+Manager+1.10.0进行分布式部署。进入商店中的“我的订阅”选项卡后,我无法为订阅的API重新生成密钥并获得HTTP 400错误。 Key Mgr日志显示:wso2 api管理器1.10无法重新生成令牌
TID: [-1234] [] [2017-03-07 20:26:14,730] ERROR {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint} - Error while creating the Carbon OAuth token request {org.wso2.carbon.identity.oauth.endpoint.token.OAuth2TokenEndpoint}
OAuthProblemException{error='invalid_request', description='Missing grant_type parameter value', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
at org.apache.oltu.oauth2.common.exception.OAuthProblemException.error(OAuthProblemException.java:59)
at org.apache.oltu.oauth2.common.utils.OAuthUtils.handleOAuthProblemException(OAuthUtils.java:167)
...
I get the same if I use a curl command:
curl -k -v -d "token=224cd22cd6b4ee622d951c69be34f633&grant_type=client_credentials" -H "Authorization: Basic eG9HSnZDS3FYNVNSazV6N3FHZXhhR3VTSWVnYTpzUTQ0QlBmTXRacG1ZNnA3ZUdPejhONVZxMGdh" -H "Content-Type: application/x-www-form-urlencoded" http:GATEWAY_HOST/revoke
看起来像撤销API调用缺少“grant_type”参数。文档是否正确? :https://docs.wso2.com/display/AM1100/Token+API
是的,好像你缺少授权类型。它通常是'password'或'refresh_token',但它取决于API文档。 – Coder