Oauth2 refresh token does not work

Not applicable

Hello;

I have a problem with Oauth2 policy. I use external IdP (Azure) to make authentication and Apigee to reuse the authorization sent by the IdP.

This is the policy that I made but I have a problem, I can not find how include the refresh token into the response

<?xml version="1.0" encoding="UTF-8"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="OAuthV2-GenerateAccessToken">
   <DisplayName>OAuthV2-GenerateAccessToken</DisplayName>
   <ExternalAuthorization>true</ExternalAuthorization>
   <Operation>GenerateAccessToken</Operation>
   <SupportedGrantTypes>
      <GrantType>client_credentials</GrantType>
   </SupportedGrantTypes>
   <ReuseRefreshToken>true</ReuseRefreshToken>
   <RefreshToken>gauth_refresh_token</RefreshToken>
   <ExternalAccessToken>gauth_access_token</ExternalAccessToken>
   <StoreToken>true</StoreToken>
   <GenerateResponse enabled="true" />
   <Tokens />
</OAuthV2>
0 1 473
1 REPLY 1

The Client Credentials grant type cannot include a refresh token. This is because there is no end user in the flow, so the client would just request a new token.

If you change this to the password grant type, you will receive a refresh token.

Hope this helps!