The 'redirect_uri' parameter must be an absolute URI that is whitelisted in the client app settings

#1

Hello trying this tutorial

And I’m getting what seems to be a typical problem with people starting out, but none of the solutions i’m seeing are working for me. Hopefully someone can help see where I am going wrong.

{
“web”: {
“client_id”: “1…2”,
“client_secret”: “1…2”,
“auth_uri”: “h://dev-1…2.oktapreview.com/oauth2/default/v1/authorize”,
“token_uri”: “h://dev-1…2.oktapreview.com/oauth2/default/v1/token”,
“issuer”: “h://dev-1…2.oktapreview.com/oauth2/default”,
“userinfo_uri”: “h://dev-1…2.oktapreview.com/oauth2/default/userinfo”,
“redirect_uris”: [
“h://localhost:5000/oidc/callback”
]
}
}

app = Flask(name)
app.config[“OIDC_CLIENT_SECRETS”] = “client_secrets.json”
app.config[“OIDC_COOKIE_SECURE”] = False
app.config[“OIDC_CALLBACK_ROUTE”] = “/oidc/callback”
app.config[“OIDC_SCOPES”] = [“openid”, “email”, “profile”]
app.config[“SECRET_KEY”] = “1…2”
app.config[“OIDC_ID_TOKEN_COOKIE_NAME”] = “oidc_token”
oidc = OpenIDConnect(app)
okta_client = UsersClient(“h://1…2.oktapreview.com”, “1…2”)

in my app settings in Okta my “Login redirect URIs” is set to “redirect_uris” above in my client_secrets.

Not sure what else to try.

Thanks in advance

2 Likes

#2

Hello,

I have just found this, not sure if it is gonna solve your problem (and mine) but I will share my results.

Regards,

Manu

0 Likes

#3

I am getting this error too and my code is just have you @JLC have stated above. I also verified that my redirect_uris link in the client_secrets.json file match the application ‘Login redirect URIs’ from the ‘General’ tab->general settings->Login section. Feel like I am close as my logo shows up in the header of the bad request page, but not working still.

0 Likes

#4

Hi, did you manage to fix this?

0 Likes

#5

Hi @miyoro

Please check out the article available here in order to resolve this issue.

0 Likes

#6

I’ve been following the article and have made sure that my URIs are exactly the same (I have even copy-pasted)

0 Likes

#7

Hi @miyoro

Can you please send us an email to developers@okta.com to have this issue further investigated?

0 Likes

#8

The Url that comes up when making the request shows the rederict URI as

redirect_uri=http%3A%2F%2Ftwitteranalyserwebapp.xxbtbkmhad.eu-west-2.elasticbeanstalk.com%2Foidc%2Fcallback

Any help will be greatly appreciated…

0 Likes

#9

Okay, sending an email now.

0 Likes

#10

If anyone else gets stuck like me, the solution was to convert the url to lowercase as that is how it was being passed in the redirect URI.

0 Likes