The problem is, when the request with header is sent, it causes this error:
System.InvalidOperationException: IDX20803: Unable to obtain configuration from: ‘System.String’.
at Microsoft.IdentityModel.Protocols.ConfigurationManager1.GetConfigurationAsync(CancellationToken cancel) at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync() at Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler.HandleAuthenticateAsync() at Microsoft.AspNetCore.Authentication.AuthenticationHandler1.AuthenticateAsync()
at Microsoft.AspNetCore.Authentication.AuthenticationService.AuthenticateAsync(HttpContext context, String scheme)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
Would anyone know what is causing this? It doesn’t seem to like any token, especially any with ‘bearer’ prefixing it, but that’s what the tutorial says…
How exactly did you configure your backend middleware and initialize your backend during startup? It seems to me that your backend app fails to pull OIDC meta configuration from Okta.
OK i figured it out based on you telling me to look more closely at the Authority provider :). I simply had:
“Authority”: “https://xxx.oktapreview.com/oauth/default” instead of:
“Authority”: “https://xxx.oktapreview.com”. I think I just followed some bad advice on stack overflow for this one.
Thank you so much for help