# Custom login redirect\_uri error

**URL:** <https://devforum.okta.com/t/custom-login-redirect-uri-error/1934>\
**Category:** Questions\
**Created:** [June 11, 2018, 9:50am UTC](https://devforum.okta.com/t/custom-login-redirect-uri-error/1934 "2018-06-11T09:50:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Augustin92](https://avatars.discourse-cdn.com/v4/letter/a/7993a0/32.png) [@Augustin92](https://devforum.okta.com/u/Augustin92)\
**Post date:** [June 11, 2018, 9:50am UTC](https://devforum.okta.com/t/custom-login-redirect-uri-error/1934/1 "2018-06-11T09:50:44Z")

</div>

Hi Team,

Its regarding the project on [https://github.com/okta/samples-java-spring/tree/master/custom-login](https://github.com/okta/samples-java-spring/tree/master/custom-login)

I have imported the above project and made necessary changes related to my Okta tenant. When I run this project its server was up and I’m able to access the home page where it shows Login button, after clicking the login button its redirects to below url where its throws 400 bad request.

https://{myOrg}/oauth2/default/v1/authorize?client\_id={client\_id}&redirect\_uri=http://localhost:8080/authorization-code/callback&response\_type=code&scope=openid&state=uCoy3S

Error code: invalid\_request  
Error msg: “The reditect\_uri must be an absolute URI that is whitelisted in the client app settings”

attached screenshots for reference.

Please help.

---

<div class="post-metadata">

**Author:** ![bretterer](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/bretterer/32/244_2.png) [@bretterer](https://devforum.okta.com/u/bretterer)\
**Post date:** [June 11, 2018, 1:49pm UTC](https://devforum.okta.com/t/custom-login-redirect-uri-error/1934/2 "2018-06-11T13:49:53Z")

</div>

What that is saying is in your application settings inside of the Developer console, you need to go to the application settings and set a whitelisted redirect uri. see below.

 ![PHP_-OpenID_Connect_Client__My_Web_App-_Okta_Hosted_Login_Example](https://global.discourse-cdn.com/oktadev/original/1X/7da8c7961c5794cabba9e8fc1fa4b77c1bffc3a0.png)

Make sure in the highlighted field, you have `http://localhost:8080/authorization-code/callback` set

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 12, 2024, 10:38pm UTC](https://devforum.okta.com/t/custom-login-redirect-uri-error/1934/3 "2024-01-12T22:38:52Z")

</div>

Closed on January 12, 2024, 10:38pm UTC

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