Foundry's OAuth2 API Endpoints

Viewed 114

I want to test the "Third-party applications" access using Postman.

When trying to obtain an OAuth token I am receiving a '404 Not Found' from Foundry. I suspect that I've configured the wrong URLs for the OAuth2 endpoints.

From reading the documentation

https://<foundryhost.com>/workspace/documentation/product/foundry-backend/security-api#oauth2-api-endpoints

I put together the following 2 endpoints:

  • Auth URL: https://<foundryhost.com>/api/oauth2/authorize
  • Access Token URL: https://<foundryhost.com>/api/oauth2/token

Are those correct or am I missing something?

1 Answers

You're on the right track with the service context path - in this case it's multipass - which is Foundry's authentication service.

Try this:

authorize_url=FOUNDRY_STACK + 'multipass/api/oauth2/authorize',
access_token_url=FOUNDRY_STACK + 'multipass/api/oauth2/token'

Looks like the docs could do with some clarification. Will get that fixed.

Another gotcha to remember with OAuth2 on Foundry: the refresh token rotates on use - remember to save both when you request a new access token (this is compliant with the standard, but it is optional).

Related