Skip to content

NullReferenceException in Sample  #195

Description

@Mark-Good

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions