You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here’s the piece of code I have to get user details. While I do receive the user details, I also encounter the above exception, which seems to bypass but still gives me the result.
var oktaConfig = new Configuration()
{
Token = configuration[“OktaToken”],
OktaDomain = configuration[“OktaDomain”],
};
UserApi = new UserApi(oktaConfig);
var user = UserApi.GetUserAsync(“[email protected]”).Result;
var name = user.Profile.DisplayName;
Has anyone found a solution for this issue? Any guidance would be greatly appreciated!
What is expected to happen?
Call the OKTA API without any error
What is the actual behavior?
When I run the solution, Visual Studio breaks at the GetAllProperties() method inside ConfigurationBinder.cs because type is null. I can continue through the errors and it will eventually run, however I’m not sure if the results are accurate.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Extensions.Configuration.Binder
StackTrace:
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetAllProperties(Type type) in /_/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs:line 654
Furthermore, the calling line in the OKTA SDK is Okta.Sdk.Client.Configuration.cs, Line 594, GetConfigurationOrDefault().
That line reads:
configurationBuilder.Build().GetSection("okta").GetSection("client") .Bind(configuration);
The line that calls that is line 39 in Okta.Sdk.Api.UserApi():
configuration = Okta.Sdk.Client.Configuration.GetConfigurationOrDefault(configuration);
Reproduction Steps?
When I run the solution, Visual Studio breaks at the GetAllProperties() method inside ConfigurationBinder.cs because type is null. I can continue through the errors and it will eventually run, however I’m not sure if the results are accurate.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Extensions.Configuration.Binder
StackTrace:
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetAllProperties(Type type) in /_/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs:line 654
Furthermore, the calling line in the OKTA SDK is Okta.Sdk.Client.Configuration.cs, Line 594, GetConfigurationOrDefault().
That line reads:
configurationBuilder.Build().GetSection("okta").GetSection("client") .Bind(configuration);
The line that calls that is line 39 in Okta.Sdk.Api.UserApi():
configuration = Okta.Sdk.Client.Configuration.GetConfigurationOrDefault(configuration);
Additional Information?
No response
.NET Version
.net 6.0
SDK Version
Okta.AspNetCore version is 4.6.1
Okta.Sdk version tried 8.0.1 and 9.0.3(latest) both have same issue
Okta.Auth.Sdk version is 2.0.5
OS version
No response
The text was updated successfully, but these errors were encountered:
Thanks for responding on our issue request. Is there any ETA for this and priority defined ? We are currently in holding pattern due to this so want to know.
Describe the bug?
I’m experiencing a similar issue to what is discussed in
(https://devforum.okta.com/t/getconfigurationordefault-throwing-object-reference-not-set-to-an-instance-of-an-object/28968).
The Okta.AspNetCore version that I am on is 4.6.1
Here’s the piece of code I have to get user details. While I do receive the user details, I also encounter the above exception, which seems to bypass but still gives me the result.
var oktaConfig = new Configuration()
{
Token = configuration[“OktaToken”],
OktaDomain = configuration[“OktaDomain”],
};
UserApi = new UserApi(oktaConfig);
var user = UserApi.GetUserAsync(“[email protected]”).Result;
var name = user.Profile.DisplayName;
Has anyone found a solution for this issue? Any guidance would be greatly appreciated!
What is expected to happen?
Call the OKTA API without any error
What is the actual behavior?
When I run the solution, Visual Studio breaks at the GetAllProperties() method inside ConfigurationBinder.cs because type is null. I can continue through the errors and it will eventually run, however I’m not sure if the results are accurate.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Extensions.Configuration.Binder
StackTrace:
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetAllProperties(Type type) in /_/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs:line 654
Furthermore, the calling line in the OKTA SDK is Okta.Sdk.Client.Configuration.cs, Line 594, GetConfigurationOrDefault().
That line reads:
configurationBuilder.Build().GetSection("okta").GetSection("client") .Bind(configuration);
The line that calls that is line 39 in Okta.Sdk.Api.UserApi():
configuration = Okta.Sdk.Client.Configuration.GetConfigurationOrDefault(configuration);
Reproduction Steps?
When I run the solution, Visual Studio breaks at the GetAllProperties() method inside ConfigurationBinder.cs because type is null. I can continue through the errors and it will eventually run, however I’m not sure if the results are accurate.
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=Microsoft.Extensions.Configuration.Binder
StackTrace:
at Microsoft.Extensions.Configuration.ConfigurationBinder.GetAllProperties(Type type) in /_/src/libraries/Microsoft.Extensions.Configuration.Binder/src/ConfigurationBinder.cs:line 654
Furthermore, the calling line in the OKTA SDK is Okta.Sdk.Client.Configuration.cs, Line 594, GetConfigurationOrDefault().
That line reads:
configurationBuilder.Build().GetSection("okta").GetSection("client") .Bind(configuration);
The line that calls that is line 39 in Okta.Sdk.Api.UserApi():
configuration = Okta.Sdk.Client.Configuration.GetConfigurationOrDefault(configuration);
Additional Information?
No response
.NET Version
.net 6.0
SDK Version
Okta.AspNetCore version is 4.6.1
Okta.Sdk version tried 8.0.1 and 9.0.3(latest) both have same issue
Okta.Auth.Sdk version is 2.0.5
OS version
No response
The text was updated successfully, but these errors were encountered: