Report this

What is the reason for this report?

400 Bad Request; The 'redirect_uri' parameter must be an absolute URI

Posted on March 15, 2020

During authorize request of implicit or authorization code flow (Open ID or OAuth), following error is returned.

http://https://support.okta.com/help/s/article/The-redirect-uri-parameter-must-be-an-absolute-URI

The suggested link did not resolve my issue. I believe the issue is something with the redirect uri being outdated? Do you have the updated uri?

Mine is: redirect_uri: 'http://localhost:3000/users/callback',



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hello,

A common issue that can result in the “400 Bad Request; The ‘redirect_uri’ parameter must be an absolute URI” error is that the specified redirect URI does not exactly match the one registered in your authorization server configuration (e.g., Okta).

Ensure that the redirect_uri configured in your application and the one in your Okta application settings match exactly. This includes any trailing slashes, paths, or parameters. The redirect URI must be a complete URL, including the scheme (http:// or https://), host (localhost), and port (:3000) if any.

Here are the steps to check the Redirect URIs in your Okta application:

  1. Log in to your Okta account.
  2. Navigate to the Applications section.
  3. Click on the application that you’re using for authorization.
  4. Check the “Login redirect URIs” section. The URI http://localhost:3000/users/callback should be listed there. If it’s not, add it.

Also, check your application’s configuration. The redirect_uri should be set exactly to http://localhost:3000/users/callback as per your message.

If you’re still having trouble, it’s also worth checking your application and server logs for any additional error messages or warnings. This could provide more context to help diagnose the problem.

If you are developing on a local machine, make sure you are running your app on the specified port (in your case, port 3000) and the route /users/callback is correctly set up to receive the authorization callback.

Best,

Bobby

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.