2

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?

TylerH
  • 20,799
  • 66
  • 75
  • 101
twinkle2
  • 341
  • 1
  • 8
  • ok I did some further digging in the documentation. Between hostname and and /api I need the SERVICE_CONTEXT_PATH as stated here: `https:///workspace/documentation/product/foundry-backend/make-api-call#api-url-base`. But I cannot find the SERVICE_CONTEXT_PATH for OAuth. – twinkle2 Feb 21 '22 at 14:23
  • Not editing OPs question, so dropping links here: https://www.palantir.com/docs/foundry/platform-security-third-party/writing-oauth2-clients/#supporting-oauth2-integration and https://www.palantir.com/docs/foundry/api/general/overview/making-requests/ – fmsf May 12 '22 at 09:59

1 Answers1

4

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).

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Tom P
  • 101
  • 3