-
Notifications
You must be signed in to change notification settings - Fork 357
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
Null Reference Exception | PostConfigureApplicationCookieTicketStore #1689
Comments
Everything seems to work fine as soon as I comment out the
|
This looks like a bug. I'm transferring this issue to the IdentityServer repository where it can be triaged. |
IdentityServer 7.1.0-rc.2 was just released, which should fix this issue. @kyle-sexton would you please try updating your package reference and let us know the results? Thanks very much! |
I have updated to the latest prelease and can happily report that the error is no longer happening :) I have re-enabled server side sessions, and tested registration, login/logout, and navigation around several pages. I also quickly tested an Angular UI using a BFF and didn't have any errors with back channel communication. I'll do some more thorough testing, but the initial results are looking good. @josephdecock thank you for taking a look at this, and providing a fix. I'm a fan of the product and the team! Also, @RolandGuijt - I've watched your Pluralsight videos over the years, and appreciate your insights. The Authentication and Authorization in Angular course was particularly helpful. |
Thanks so much! It is really helpful to get good bug reports like yours while we have a release candidate, and testing out our fix right away is very much appreciated! |
Which version of Duende IdentityServer are you using?
7.1.0-rc.1
Which version of .NET are you using?
.NET 9
Describe the bug
After upgrading I am experiencing a null reference exception on startup. After looking at the changes, and debugging the
PostConfigureApplicationCookieTicketStore
locally I can see that the _licenseUsage is set to null in the constructor due to the httpContextAccessor being null. I do have the line in service registration that adds the HttpContextAccessor to the service provider, but am assuming this is null due to the the constructor being executed shortly after app.RunAsync() is called and there is no active HTTP request yet.To Reproduce
Upgrade to 7.1.0-rc.1, fix compile errors (if any) and startup the application. I have a combination of the Entity Framework and ASP.NET Identity quickstart.
Expected behavior
Expected app to start up without errors, and allow navigation around the home/index page, login page, and all other ASP.NET identity related pages.
Log output/exception with stacktrace
Additional context
I have gone through the breaking changes section in the release and updated the constructor of my custom / extended configuration store DB context class, and namespaces from IdentityModel to Duende.IdentityModel. I haven't changed anything else except for the other Duende packages for ASP.NET Identity and Entity Framework Core.
I do have some additional cookie option related calls in my code such as
services.ConfigureApplicationCookie()
. I've tried commenting these out but they haven't seemed to have an effect. You might notice the other middleware listed in the stack trace. Those are only enabled in the dev environment and are mapped to specific paths that aren't being hit.Hope this helps. I may have something weird in my startup code that is affecting it, but figured I'd create an issue and start the discussion. Its worth noting that the previous 7.0.8 version had worked just fine, and I haven't made many major changes to the code. Let me know if you need any additional information.
The text was updated successfully, but these errors were encountered: