aspnet / Security

[Archived] Middleware for security and authorization of web apps. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
1.27k stars 599 forks source link

Sharing Cookie between Aspnet core and legacy .NET app using Cookie Middleware #1109

Closed aagarwal10 closed 7 years ago

aagarwal10 commented 7 years ago

I am trying to share cookie between Aspnet Core App (using 4.6.1 framework) and Aspnet WebForms (using 4.6.1 framework) using above documentation. I am using Redis implementation of ITicketStore for Aspnet Core Cookie Middleware and have Redis implementation of IAuthenticationSessionStore for Webforms CookieMiddleware. Now my question, is it possible to share cookie between my two .NET apps using Redis as Session Store since both use different version of AuthenticationTicket serialized into same instance of Redis for sharing session??

AuthenticationTicket used in Core App is from Microsoft.AspNetCore.Authentication AuthenticationTicket used in Webforms App is from Microsoft.Owin.Security

I hope my problem statement is clear.

Please advise here.

Eilon commented 7 years ago

You should be able to use the Microsoft.Owin.Security.Interop package in your Katana / ASP.NET 4.x (e.g. Web Forms) application, which will make its cookies be compatible with ASP.NET Core.

You can use the serializer in this package for both the ticket store and the session store.

WayneCBarker commented 6 years ago

Is this the only way? The lagacy app must be changed to implement OWIN if you want to share the AuthenticationTicket with a webforms app?

Tratcher commented 6 years ago

Comments on closed issues are not tracked, please open a new issue with the details for your scenario.