Skip to content
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

SystemWebChunkingCookieManager not working #355

Closed
mrcferri opened this issue May 15, 2020 · 5 comments
Closed

SystemWebChunkingCookieManager not working #355

mrcferri opened this issue May 15, 2020 · 5 comments

Comments

@mrcferri
Copy link

Using the default ChunkingCookieManager everything worked fine, except occasional redirect loops, as widely known with ASP.NET (#197).
To avoid bad surprises, before going in production I switched to SystemWebChunkingCookieManager as suggested. However, for some reason the authentication cookie is not sent. Any hints to solve this problem?

@Tratcher
Copy link
Member

  • Can you share the relevant Startup code where you're configuring auth?
  • Which package version are you using?
  • The server logs may also help. https://github.com/aspnet/AspNetKatana/wiki/Debugging
  • Fiddler traces are also useful if you're doing any remote auth (OAuth, OIDC, etc.).

@mrcferri
Copy link
Author

The Startup code is quite simple

        public void ConfigureAuth(IAppBuilder app)
        {
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = "Cookies",
                CookieManager = new Microsoft.Owin.Host.SystemWeb.SystemWebChunkingCookieManager(),
                LoginPath = new PathString("/login")
            });

            app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
	//  Google, Twitter & Facebook handlers follow...
	}

Package version: 4.1
IIS: 8.5
MVC: 5.2

I follow your instructions to output tracing to a file, but I didn't get any output and nothing I saw in VS console related to Microsoft.Owin.

Currently, I'm testing locally.

@Tratcher
Copy link
Member

Looks ok. Can you share a Fiddler trace file?

@mrcferri
Copy link
Author

Actually, my code wasn't right.
I just copied an example using SystemWebChunkingCookieManager, where ApplicationType was set to "Cookies", directly as a string.
Reverting to my original code

AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie;

everything works fine. In fact, the correct value to assign is "ApplicationCookie" not "Cookies".

By the way, does SystemWebChunkingCookieManager get rid of the redirect loop once for all? And maybe even of the occasional "Server cannot append header after HTTP headers have been sent" error?

Thanks a lot.

@Tratcher
Copy link
Member

There are several kinds of redirect loops, but it does address the missing auth cookie one.

"Server cannot append header" is a different issue related to child requests. #74

@ghost ghost locked as resolved and limited conversation to collaborators Jun 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants