# Oauth2/authorize generic bad request error

**URL:** <https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181>\
**Category:** Get Help\
**Tags:** application, sso\
**Created:** [January 10, 2025, 7:06pm UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181 "2025-01-10T19:06:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![eelcodev67](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eelcodev67/32/61412_2.png) [@eelcodev67](https://community.auth0.com/u/eelcodev67)\
**Post date:** [January 10, 2025, 7:06pm UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181/1 "2025-01-10T19:06:17Z")

</div>

Hello,  
I have an existing set of code which I use for one customer that uses auth0 /Okta.  
Which works fine (so i assume the code is correct).  
But now i have another customer that uses Okta, I get to the login page, and can login, which according to the system\_log is valid.  
But the only response in the browser is a super generic “400 Bad Request”.

 ![okta400](https://global.discourse-cdn.com/auth0/original/3X/9/3/937a334ce869087910b3d73b75af72296399aa3c.jpeg)

Is there any way to find out what the actual error is?  
I’ve been going around with this for over 4 hours now, it’s driving me insane that I cannot find any more info on the error or get it fixed, I checked the urls, even created a new application in the client’s Okta account to test.

If it helps (personal data replaced by XXXX), this is the url I start the login on  
[https://dev-XXXX.okta.com/login/login.htm?fromURI=%2Foauth2%2Fauthorize%3Fresponse\_type%3Dcode%26client\_id%XXXX%26redirect\_uri%3Dhttps%3A%2F%2XXXX%2Fcallback%26scope%3Dopenid%2Bprofile%26response\_mode%3Dquery%26state%3DpnqqLAoaiXMi%26nonce%3DpnqqLAoaiXMi](https://dev-XXXX.okta.com/login/login.htm?fromURI=%2Foauth2%2Fauthorize%3Fresponse_type%3Dcode%26client_id%25XXXX%26redirect_uri%3Dhttps%3A%2F%252XXXX%2Fcallback%26scope%3Dopenid%2Bprofile%26response_mode%3Dquery%26state%3DpnqqLAoaiXMi%26nonce%3DpnqqLAoaiXMi)

And then this is the url where I end up after the login, which shows the error

[https://dev-XXXX.okta.com/oauth2/authorize?response\_type=code&client\_id=XXXX&redirect\_uri=https://XXXX/callback&scope=openid+profile&response\_mode=query&state=SS9YMo2YfrI0&nonce=SS9YMo2YfrI0](https://dev-XXXX.okta.com/oauth2/authorize?response_type=code&client_id=XXXX&redirect_uri=https://XXXX/callback&scope=openid+profile&response_mode=query&state=SS9YMo2YfrI0&nonce=SS9YMo2YfrI0)

Any info or tips whatsoever is appreciated greatly

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 10, 2025, 7:20pm UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181/3 "2025-01-10T19:20:02Z")

</div>

Hi @eelcodev67,

Welcome to the Auth0 Community!

Usually, with these errors, we recommend checking your system logs to determine why the request was unsuccessful or other useful information. You could also check your network activity to verify the requests being sent contain the correct query parameters.

If you continue encountering issues, you can visit the [Okta Help Center](https://support.okta.com/help/s/?language=en_US) to find additional resources.

[Here](https://support.okta.com/help/s/question/0D54z00007lPToWCAW/400-bad-request?language=en_US) is a related Okta question that might help you with this.

Let me know if you have any further questions.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![eelcodev67](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eelcodev67/32/61412_2.png) [@eelcodev67](https://community.auth0.com/u/eelcodev67)\
**Post date:** [January 14, 2025, 1:19pm UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181/4 "2025-01-14T13:19:25Z")

</div>

In the end it turned out the wrong callback url was being used, the login has thankully been fixed.  
Unfortunately the logout is now giving a similar 400 issue, I tried passing different things as the id\_token\_hint, hoping that was the problem, but no luck yet.  
Anyone have any ideas?  
I tried the entire token I got through the default/v1/token call  
aswell as the response’s user claim type ‘sub’.

```auto

https://dev-XXXX.okta.com/oauth2/default/v1/logout?post_logout_redirect_uri=[LOGOUT_CALLBACK_URL]&id_token_hint=[HINTVALUE]

```

---

<div class="post-metadata">

**Author:** ![eelcodev67](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eelcodev67/32/61412_2.png) [@eelcodev67](https://community.auth0.com/u/eelcodev67)\
**Post date:** [January 15, 2025, 1:15pm UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181/5 "2025-01-15T13:15:48Z")

</div>

Just to add to this conversation, all problems have now thankfully finally been solved.  
Maybe I just was not paying attention or missed a part of the documentation.

But perhaps someone else could use this info also.  
The response from the call to default/v1/token  
contained the id\_token which was needed to call the logout callback?id\_hint\_token with

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [January 16, 2025, 12:29am UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181/6 "2025-01-16T00:29:43Z")

</div>

Hi @eelcodev67,

Thanks for letting us know how you solved it!

I am glad everything is working now.

Let us know if you have any further questions.

Cheers,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [January 30, 2025, 12:30am UTC](https://community.auth0.com/t/oauth2-authorize-generic-bad-request-error/168181/7 "2025-01-30T00:30:17Z")

</div>

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