-
Notifications
You must be signed in to change notification settings - Fork 4k
Emit more logging and errors around authentication scheme at startup #2646
Comments
Do you have a repro for this or a call stack? I can't seem to cause this NRE in our host with our samples. |
@silamon any update? if you can't help us repo this report, then there's nothing we can do to fix it. |
Sorry for the late response. I reverted back to 2.2.0 after submitting the bug report. The exception no longer happens when I return to 2.3.0 preview now so I have not been able to reproduce this anymore. I can still remember that the NRE was caused on login. In LoginPageResult |
I've been able to reproduce it now. That day I tried to set different authentication schemes. This is the original code: Then I played around and used:
(Just for the clarification, I have combined API & IdentityServer in one project. Therefore I need authentication & authorization for the API, but not for the Identity Server. ) |
Ok, that helps. I'll look into it. |
Can you show me your entire Startup that's not working? |
IdentityServerAuthenticationDefaults.AuthenticationScheme is "Bearer", mind you. So that's fundamentally wrong for the default scheme. That's not something that should have been working previously. |
And so to complete my thought... the default scheme needs to be your cookie scheme, or you can set the new
|
Thanks for helping me out, but I've already found a solution now that both API & Auth are combined. For this issue, it may be great if you could add an (better) exception which is given if the authentication scheme is not correctly set. It didn't really work in v2.2 but gave an exception after correct login: If you don't feel like an exception is required, you may close the issue. |
This exception is thrown by the Microsoft plumbing, not us. I think what might be nice is if we check at startup if we can determine the default authentication scheme and if it is cookies and if not then we issue a warning/error in the logs. |
I added additional logging at startup to help with this issue. @leastprivilege please have a look. |
all done and reviewed |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Issue / Steps to reproduce the problem
We are receiving NullReference exceptions because we do not fill in the UserInteractionOptions. Earlier in the v2.2.0 build, this was automatically filled with default values when the IdentityServerOptions is initialized. Now in the preview of v2.3.0, it looks like the default path is no longer filled in automatically. It remains furthermore null causing NullReference exceptions on other places.
Related: #2532
The text was updated successfully, but these errors were encountered: