-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Unable to access proper values for CookieAuthenticationOptions #17631
Comments
The ASP.NET Core authentication handlers use named options (matching what's called the "authentication scheme"), so the fact you're getting a "blank" instance when using Instead, use |
I get the default values, for example,
Let me check |
Or better, return a proper challenge, e.g by calling |
Do you mean Also |
Yeah and yeah (never reply when on your smartphone 🤣) |
Thanks, it works :) Could you please let me know why this causes an issue while |
You mean That's because it's name-aware and only amends the options attached to the Essentially, it does something like this: public void PostConfigure(string name, CookieAuthenticationOptions options)
{
if (name is not IdentityConstants.ApplicationScheme)
return;
// Only amend the options if the options name matches the application scheme (main cookie instance used by Identity).
} |
I mean |
The But even if they were not named, it wouldn't be problematic anyway as OrchardCore/src/OrchardCore/OrchardCore.Users.Core/Services/ConfigureSecurityStampOptions.cs Lines 7 to 35 in 2d2339c
|
Describe the bug
While I'm working on
OrchardCoreContrib.ContentPermissions
I noticed that callingIOptions<CookieAuthenticationOptions>
from DI gets default values, not the one that are set by OCOrchard Core version
Latest bits
To Reproduce
Try to get the
IOptions<CookieAuthenticationOptions>
from any Controller, View, or Razor PageExpected behavior
It should return the values that are overridden by the
OC.Users
module`Logs and screenshots
None
The text was updated successfully, but these errors were encountered: