Open Mark-Good opened 1 year ago
Hello @Mark-Good, I also got into the same issue. Have you tried adding the Okta configuration file? Here are the steps: https://github.com/okta/okta-idx-dotnet/blob/master/README.md#configuration-reference
If you're using IIS Express, the okta.yaml file should be placed in C:\Program Files\IIS Express\okta.yaml
Describe the bug?
I configured the sample app called embedded-sign-in-widget according to Installation & Running The App. But when I run the app and try to open the Sign In Widget page, I get
NullReferenceException: Object reference not set to an instance of an object.
Okta.Idx.Sdk.Configuration.IdxConfigurationValidator.Validate(IdxConfiguration configuration)
I see that the accounts controller takes IIdxClient in its constructor, and the following DI is set up in Program.Main:
builder.Services.AddScoped<IIdxClient, IdxClient>();
IdxClient has two constructors. One empty constructor and that takes three parameters, including IdxConfiguration. All of them default to null. It appears that configuration is null when dependency injected.
What is expected to happen?
The sample should run after following Installation & Running The App.
What is the actual behavior?
NullReferenceException: Object reference not set to an instance of an object.
Okta.Idx.Sdk.Configuration.IdxConfigurationValidator.Validate(IdxConfiguration configuration)
Reproduction Steps?
Additional Information?
No response
.NET Version
7.0.102
SDK Version
Okta.Idx.Sdk 2.2.8 Okta.AspNetCore 4.4.2
OS version
No response