我下載並安裝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