Hi Friends,
I am trying to implement three legged oauth with the sample proxies given at https://github.com/apigee/api-platform-samples/tree/master/sample-proxies/oauth-advanced. When I tried to call the generate Access token flow to get acces token through postman, with the auth code generated I got the following response.
{ "fault": { "faultstring": "invalid_request", "detail": { "errorcode": "invalid_request" } } }
My Request is as follows:
With header,
Authorization : Basic base64(client_id:client_secret)
In trace I found an error after GenerateAccessToken Policy like:
error | invalid_request |
---|---|
error.class | com.apigee.oauth.v2.TokenGenerationException |
Identifier | fault |
proxy.flow.name | AccessTokenRequest |
state | PROXY_REQ_FLOW |
type | ErrorPoint |
My generateAccessToken policy is as follows:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <OAuthV2 async="false" continueOnError="false" enabled="true" name="AccessTokenRequest">
<DisplayName>AccessTokenRequest</DisplayName>
<ExpiresIn>3600000</ExpiresIn>
<ExternalAuthorization>false</ExternalAuthorization>
<Operation>GenerateAccessToken</Operation> <GenerateResponse enabled="false">
<Format>FORM_PARAM</Format>
</GenerateResponse>
<ReuseRefreshToken>false</ReuseRefreshToken>
<SupportedGrantTypes>
<GrantType>authorization_code</GrantType>
<GrantType>client_credentials</GrantType>
</SupportedGrantTypes>
<Tokens/>
</OAuthV2>
Can anyone suggest where I went wrong?