simple external oAuth service callout

Not applicable

Hi I am using a very simple service callout to verify our third-party oAuth token, but I keep getting a timeout error even when I set the timeout.

I am verifying the token with a GET request like this: https://{external_URL}/oauth/token/user?=access_token={oAuthtoken}

On the music example: https://github.com/dzuluaga/apigee-tutorials/tree/master/apiproxies/musicapi-oauth-delegated-authent... from the http://docs.apigee.com/api-services/content/use-third-party-oauth-system, it seems that it's passed in as a header parameter instead of query.

Am I not verifying the token correctly in apigee when I pass it in as a query param with GET verb?

Error I am getting:

{ "fault": { "faultstring": "Execution of ServiceCallout OAuthVerifyCall failed. Reason: timeout occurred in OAuthVerifyCall", "detail": { "errorcode": "steps.servicecallout.ExecutionFailed" } } }

ServiceCallout policy:

<Properties/>

<Request clearPayload="true" variable="OAuthVerifyRequest"> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>

</Request>

<Response>OAuthVerifyResponse</Response>

<Timeout>3600000</Timeout>

<HTTPTargetConnection>

<Properties>

<Property name="success.codes">1xx,2xx,3xx,4xx</Property>

</Properties>

<URL>https://{external_URL}/oauth/token/user</URL>

</HTTPTargetConnection>

Assign Message policy:

<Set>

<QueryParams>

<QueryParam name="access_token">{oauthtoken}</QueryParam>

</QueryParams>

<Verb>GET</Verb>

</Set>

0 5 709
5 REPLIES 5

Not applicable

@Barbara: Are you getting timeout in Apigee only? have you checked that third-party OAuth API not giving any time time out in Postman or SoapUI...?

Hi Sachhida, I ran the apigee proxy immediately after I generated an access token. Then, I validated my apigee token with the GET request that I mentioned before on Postman, and the token is still valid.

@Barbara: the resource you created and service call out, are they both GET?

don't set access_token in other assign message policy. set in the service call out request.

for you reference service call out policy:

<Properties/> <Request clearPayload="true" variable="OAuthVerifyRequest"> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Set> <QueryParams> <QueryParam name="access_token">{{oauthtoken}</QueryParam> </QueryParams> <Headers> <Header name="Accept">application/json</Header> </Headers> <Verb>GET</Verb> </Set> </Request> <Response>OAuthVerifyResponse</Response> <Timeout>3600000</Timeout> <HTTPTargetConnection> <Properties> <Property name="success.codes">1xx,2xx,3xx,4xx</Property> </Properties> <URL>https://{external_URL}/oauth/token/user</URL> </HTTPTargetConnection>

Thank you! I will change that policy and try to resolve the network error as well. Yes the resource I created and the service call out are both GET.

Actually I checked and you might be right that there may be a network issue with apigee and the external oAuth verification. While we fix that, do you mind letting me know if the way I am using service callout in the correct way to verify an access token with a GET method?