Client_credentials post getting 302 Found

This seems like it should be straight forward, but I’m missing something.

Using Postman:

POST to https://my sandbox.oktapreview.com/oauth2/default/v1/token

Accept: application/json
Content-Type: application/x-www-form-urlencoded

Body is x-www-form-urlencoded
grant_type=client_credentials
client_id={{myclientid}}
client_secret={{secret}}
redirect_uri=http://amp.local
scope=customScope

I’m getting a 302 Found with a Location: /error/404?fromURI=%2Foauth2%2Fdefault%2Fv1%2Ftoken

Which seems like it’s telling me the /oauth2/default/v1/token is not found, but then I would just get a 404 on the request instead of a 302.

Any help?

Side question, do I have to pass a redirect_url sense this is a machine to machine?

It’s working fine for my org.
I’m not passing any auth header.
And you don’t have to pass redirect uri for client_credentials flow.

Arg! I was calling the -admin OKTA url.

Thanks for your help.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.