Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Oauth V2 GenerateAccessToken in response flow

Not applicable

I want to generate an access token in the proxy response flow.

As mentioned in Oauth policy documentation I have set the request.header.Authorization to base64(client_id:client_secret) before the Oauth policy execution. Even then it gives me an error like :

{
  "fault": {
    "faultstring":"invalid_request",
    "detail": {
      "errorcode":"invalid_request"
    }
  }
}


My Oauthv2 policy uses external variables for token, expiry time and grant_type as follows :
<OAuthV2 name="OAuth2-generate-token">
  <Operation>GenerateAccessToken</Operation>
  <ExternalAccessToken>flow.idm.accessToken</ExternalAccessToken>
  <StoreToken>true</StoreToken>   
  <SupportedGrantTypes>       
    <GrantType>password</GrantType>    
  </SupportedGrantTypes>    
  <GrantType>flow.grant_type</GrantType>   
  <GenerateResponse enabled="false"/>    
  <ExpiresIn ref="flow.jwt.expiry">3600000</ExpiresIn>
</OAuthV2>
Solved Solved
0 6 1,245
1 ACCEPTED SOLUTION

@AlayVakil, username and password are required fields for the password grant. Pls pass them and check.

View solution in original post

6 REPLIES 6