I’m working on creating a flow in which an oauth token is generated and (hopefully) registered with Edge, where it can be validated by Edge going forward.
I successfully generate the 3rd party token, and appear to correctly register the token with edge using the following GenerateAccessToken policy. This part is successful:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 name="GenerateAccessToken" continueOnError="false">
<Operation>GenerateAccessToken</Operation>
<ExpiresIn>1800000</ExpiresIn>
<RefreshTokenExpiresIn>86400000</RefreshTokenExpiresIn>
<RedirectUri>tokenexchange.redirect_uri</RedirectUri>
<ExternalAccessToken>external-token</ExternalAccessToken>
<ExternalAuthorization>false</ExternalAuthorization>
<StoreToken>true</StoreToken>
<SupportedGrantTypes>
<GrantType>client_credentials</GrantType>
</SupportedGrantTypes>
<GenerateResponse enabled="false"/>
<ClientId>tokenexchange.requester</ClientId>
<GrantType>authority.grant_type</GrantType>
</OAuthV2>
On subsequent calls, the token is placed in the Authorization header with a Bearer prefix. I use the following VerifyAccessToken policy to attempt to validate the token (and also hopefully capture app and developer analytics):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OAuthV2 async="false" continueOnError="false" enabled="true" name="Verify-OAuth">
<DisplayName>Verify OAuth</DisplayName>
<Operation>VerifyAccessToken</Operation>
</OAuthV2>
This fails.
I’ve tried with ExternalAuthorization set to true or false in one the other or both, as well as setting the oauth_external_authorization_status variable to true (when appropriate) ahead of the verification step. I’ve tried adding in the Client ID as a form param … but I keep getting an invalid token message.
Based on the documentation at
http://docs.apigee.com/api-services/content/use-third-party-oauth-system
I don’t see what else should be done.
Please advise.