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)