Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullReferenceException in Sample #195

Open
Mark-Good opened this issue Feb 15, 2023 · 1 comment
Open

NullReferenceException in Sample #195

Mark-Good opened this issue Feb 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@Mark-Good
Copy link

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?

  1. Follow the steps in Installation & Running The App.
  2. Run the application
  3. Click the Sign In link

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

@Mark-Good Mark-Good added the bug Something isn't working label Feb 15, 2023
@reykollab
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants