Why authorization or endpoint endpoints not working?

I am trying to get the end points for my application via okta.

I am able to hit the below ones and see responses in both browser and postman.
https://xxx123.oktapreview.com/.well-known/openid-configuration?client_id=yyy

I got the below from the response.
“authorization_endpoint”: “https://xxx123.oktapreview.com/oauth2/v1/authorize”,
“token_endpoint”: “https://xxx123.oktapreview.com/oauth2/v1/token”,

But I hit the above URLs and getting
authorization endpoint - getting 400 error
token endpoint url - The endpoint does not support the provided HTTP method

I tried with authorization id, it doesnt work either.

Is it something firewall issue or some other thing which i am doing wrong.

Note: I installed the okta server in my machine, i am getting the same for that too. So I dont think it could be firewall issue.

That is the correct error message to expect from the token endpoint if you visit it in a browser. It will only respond to a POST request.

You’ll get an error from the authorization endpoint unless you provide a valid request, just visiting it in a browser won’t do anything, you need to actually pass all the OAuth parameters in the query string.

If you’re using an OAuth library then it should be doing that itself, if you’re writing the code from scratch then take a look at the list of query string parameters to add to the authorization endpoint.

1 Like

Thank you for your response and got you.

Do you have any sample to use for plain java?
I still get 401 error when i try to hit my URL… i am not sure if i am hitting okta server not and not getting okta login page.

I could get the required details with proper query parameters like client_id, response_mode, etc… More details available in the below link as i exactly followed this. Implement authorization by grant type | Okta Developer

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