Blazor WASM .Net 6 with Okta auth problem Identity Provider: Unknown

Has anything changed compared .net 5 to .net 6 on setting up Okta OIDC? I’m also using VisualStudio 2022.

Created new Blazor WASM as guides said.
Double checked every spelling.

When Running ISS Express, the app opens in browser, but pressing Log in, it goes to okta page with 400 error.

Identity Provider: Unknown
Error Code: invalid_request
Description: The ‘redirect_uri’ parameter must be a Login redirect URI in the client app settings:
htt,//dev-xxxxxxxx-admin,okta,com/admin/app/oidc_client/instance/0oa2z35hfXXXXXXXX5d7#tab-general

my callbacks:

http://localhost:44396/authentication/login-callback

  • // - /authentication/logout-callback

LH 44396 was added to trusted origins, CORS and redirect

my appsetting.json

{
“Okta”: {
“Authority”: “httpsdev-xxxxxxxx,okta,com/oauth2/default”,
“ClientId”: “0oa2z35hfXXXXXXXX5d7”
}
}

program.cs :
builder.Services.AddOidcAuthentication(options =>
{
builder.Configuration.Bind(“Okta”, options.ProviderOptions);
options.ProviderOptions.ResponseType = “code”;
//options.ProviderOptions.DefaultScopes.Add(“profile”);
//options.ProviderOptions.DefaultScopes.Add(“address”);
});

Used guides:
https://developer.okta.com/docs/guides/sign-into-spa/blazorwebasm/main/

(some links maybe looking weird, I had 5 link limit as new user)

It definitely seems like there is an issue with the redirect_uri. Are you able to capture the full /authorize url using the browser developer tools to confirm what the actual redirect_uri is being sent in the request?
https://support.okta.com/help/s/article/The-redirect-uri-parameter-must-be-an-absolute-URI

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