'redirect_uri' mismatch

Hi,

I want to secure our application with okta and followed the documentation: Sign users in to your web app using the redirect model | Okta Developer

When my application calls the /authorize endpoint of okta I get the ‘redirect_uri’ mismatch error:

400

Bad Request

Your request resulted in an error. The ‘redirect_uri’ parameter must be a Login redirect URI in the client app settings

This is the url I use to call the /authorize endpoint (the company name and the parameters client_id, state, code_challenge have been changed):

https://example.okta.com/oauth2/default/v1/authorize?client_id=0oaxxxxxxxxxxxxxx2p8&redirect_uri=http%3A%2F%2Flocalhost%3A5000%2Fauthorization-code%2Fcallback&scope=openid+email+profile+offline_access&state=someState&code_challenge=someCode&code_challenge_method=S256&response_type=code&response_mode=query

This is my current configuration for the okta app:

I already had a look at the article form the okta help center: Okta Help Center (Lightning) But I still couldn’t resolve this issue.

Can you please help me to find a solution to make the login work? Is there any obvious error that I am making?

When you get the error during the /authorize call, the authorize URL should still be in the address/URL bar. Can you try copy/pasting that URL into notepad and double checking that the client_id matches the one for this application and that the redirect_uri exactly matches one of that application’s sign-in redirect URIs? I’m wondering if the redirect_uri is maybe getting altered somehow or if the client_id/redirect_uri within your application could be misconfigured, leading to this error.

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