I have been doing some digging around and spinning my tires looking through documentation for the better part of the afternoon and I can't seem to find where my problem lies. I have a .NET 5 Web API that we are trying to configure to use OKTA for OAuth Authentication/Authorization. I have followed the tutorial steps in this document (https://developer.okta.com/docs/guides/protect-your-api/aspnetcore3/configure-packages/) and I am getting the above Error (IDX20803: Unable to obtain configuratoin from 'System.String').
In my Startup.cs, configure services has the following:
...
services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = OktaDefaults.ApiAuthenticationScheme;
options.DefaultChallengeScheme = OktaDefaults.ApiAuthenticationScheme;
options.DefaultSignInScheme = OktaDefaults.ApiAuthenticationScheme;
})
.AddOktaWebApi(new OktaWebApiOptions()
{
OktaDomain = $"{Environment.GetEnvironmentVariable("OKTA_URL")}"
});
services.AddAuthorization();
...
And my Statup.cs Configure section contains the following:
...
app.UseAuthentication();
app.UseAuthorization();
...
I am assuming it is something in my setup, but again, I have done this per the documentation, including configuring CORS as well, but I no matter what I do I do the IDX20803 Exception.