Access Workday REST Endpoint from Apigee using OAuth2.0

Access Workday REST Endpoint from Apigee using OAuth2.0

Access Workday REST Endpoint from Apigee using OAuth2.0 I want to access the Workday REST API using OAuth2.0 from Apigee Edge. Can any one give me steps to be done. I have following details from Workday

  • Workday Endpoint URL

  • Client ID

  • Client Secret - Refresh token -Client Grant Type is Authorization code grant How do I generate access token and use in Apigee to get access to Worday REST API. If some one has detail step please share it.

Authorization code is a three legged oauth. The steps for Authorization code grant type

  1. get the code from apigee
[http://myorg-test.apigee.net/oauth/authorizationcode?client_id={consumer_key}&response_type=code&redirect_uri={redirect_uri}&scope=scope1%20scope2&state={some_string}](http://myorg-test.apigee.net/oauth/authorizationcode?client_id={consumer_key}&response_type=code&redirect_uri={redirect_uri}&scope=scope1%20scope2&state={some_string})
  1. send the code in your request to get the access token from apigee
$ curl [https://{org_name}-test.apigee.net/my_oauth_proxy/accesstoken?code=Xyz123&grant_type=authorization_code](https://{org_name}-test.apigee.net/my_oauth_proxy/accesstoken?code=Xyz123&grant_type=authorization_code) -X POST -d 'client_id=bBGAQrXgivA9lKu7NMPyoYpKNhGar6K&client_secret=hAr4GngA9vAyvI4'
  1. send the request with the access token to the service having workday endpoint where access token will be validated against apigee first before sending request to the backend.
$ curl -H "Authorization: Bearer ylSkZIjbdWybfs4fUQe9BqP0LH5Z" [http://{org_name}-test.apigee.net/weather/forecastrss?w=12797282](http://{org_name}-test.apigee.net/weather/forecastrss?w=12797282)

For more reference

https://docs.apigee.com/api-platform/security/oauth/oauth-v2-policy-authorization-code-grant-type

https://docs.apigee.com/api-platform/security/oauth/access-tokens