-
Notifications
You must be signed in to change notification settings - Fork 26
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
Debugging/troubleshooting in .Net Core 3.1 #18
Comments
Update: I discovered that my
Now, as expected,
It now seems to be the basic matter of the decryption failing, although I've triple-checked to verify the decryption and validation keys and methods match between the .Net 4.x web app and the Synercoding.FormsAuthentication configuration. How can I troubleshoot this further? |
Hi, Can you try with this version? https://www.nuget.org/packages/Synercoding.FormsAuthentication/3.1.0-alpha01 If the decryption error persists, could you create a minimal, reproducible example? For example by including a validation and decryption key (freshly generated if possible, not a great idea to post production keys here ;-) ). |
I have the same question,But this problem only appears on my computer. My PC: another computer: About a month ago, my program was running normally on my computer. |
If the SSO project running in NET Core with Synercoding.FormsAuthentication, verification is also normal |
I'm trying to integrate this into a .Net Core 3.1 app so it can accept a forms authentication cookie from a legacy .Net 4.5 web app. I believe I've set things up properly in
ConfigureServices()
(excerpt below). All configuration values including the cookie name and encryption/decryption keys and methods match the .Net 4.5 app.However, when I access an
[Authorize]
protected controller action, none of theSynercoding.FormsAuthentication
orFormsAuthHelper
code is called to validate the existing authentication cookie created by the .Net 4.5 web app. Tracing into the .Net Core code, I see that in theMicrosoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke()
method,var authorizeResult = await policyEvaluator.AuthorizeAsync(policy, authenticateResult, context, resource: endpoint);
always returnsauthorizeResult.Challenged
. (Unfortunately, I cannot step into theAuthorizeAsync()
method itself to inspect its processing.) Thecontext.ChallengeAsync()
method tries to redirect to the login page (which doesn't exist), but in the process of trying to set up that redirect, theFormsAuthenticationDataFormat()
constructor is called, and theset
method of theMicrosoft.AspNetCore.Http.CookieBuilder.Name
property is called with the"MyAuthCookie"
configuration value -- so I see the configuration kicking in at that point. (TheMicrosoft.AspNetCore.Http.CookieBuilder.Name
get
method is called shortly thereafter, returning"MyAuthCookie"
).I'm puzzled why none of the
Synercoding.FormsAuthentication
code is called to try to validate the existing cookie before trying to redirect to the login page. I can see that the"MyAuthCookie"
.Net 4.5 authentication cookie does exist in theHttpContext
object with the value generated by the .Net 4.5 app.Any suggestions for how to debug or troubleshoot the configuration would be very welcome.
Here's the
ConfigureServices()
excerpt:The text was updated successfully, but these errors were encountered: