I have the following OAuth V2 policy, which seems fairly standard:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="GenerateAccessToken">
<DisplayName>GenerateAccessToken</DisplayName>
<Properties/>
<Attributes/>
<ExternalAuthorization>false</ExternalAuthorization>
<SupportedGrantTypes>
<GrantType>authorization_code</GrantType>
<GrantType>refresh_token</GrantType>
</SupportedGrantTypes>
<GenerateResponse enabled="true"/>
<Tokens/>
<RefreshToken>request.formparam.refresh_token</RefreshToken>
</OAuthV2>
However, I’m encountering the issue that the request fails when I don’t include a redirect_uri when exchanging an authorization code for an access token: {“ErrorCode” : “invalid_request”, “Error” :“Required param : redirect_uri”}
Nowhere have I explicitely configured in the policy that it should be required, and according to the Apigee documentation, it should be optional.
It should be and is required when requesting an authorization code, but it shouldn’t when exchanging that code for an access token, because this is server-to-server communication anyway.
What’s causing the redirect_uri to be required in this case? Have I made a mistake with configuring the proxy?
