I try to SAML with Sustainsys.Saml2. I downloaded and run examples from their Github page. But all examples for ASP.NET MVC.
I develop my site with ASP.Net Web Forms. My site is service provider for SAML. I changed my web config as in the example but I can't redirect my login page to identity provider's login page.
The HttpModule sample is set up in the same way as a Web Forms app should be set up.
Related
I have a .NET Web Forms website running in IIS (using forms authentication).
I've added a .NET Core 2.2 website as a sub application of the Web Forms site.
Is it possible to share authentication from the Web Forms site to the Core site?
I came across this: https://github.com/dazinator/AspNetCore.LegacyAuthCookieCompat
and was able to check for the forms auth cookie from the parent site when a requests hits the core sub application.
Then I could decrypt the forms auth cookie, to get the user info, and authenticate the user on the core site.
Not sure if this is ideal, because you know have to manage 2 cookies, but it seems to work.
I have a solution with an existing web forms website project (NOT web application project). I want to add a new mvc web application to the solution and have web forms site and mvc web app share forms authentication. I followed the article from microsoft but on localhost this does not work. In the solution, if I start both the webforms and mvc sites they have different port numbers for localhost so I authenticate in the webforms web site but the authentication cookie does not get picked up. Is there something obvious I am missing?
Forms Authentication Across Applications
I have an ASP.NET web application that is using ASP.NET Identity for login with UseCookieAuthentication in the Startup.
The login site is working fine.
I also have an ASP.NET WebAPI site that I use to gather data. I would like to secure the WebAPI with the same cookie that was created at the Login web site.
The machine keys are identical and the UseCookieAuthentication is using the same CookieName and CookieDomain settings.
I can't seem to find any good articles on how to use Cookie based auth between ASP.NET sites.
Any links or ideas are welcome.
If there are any examples passing ClaimsIdentity between two sites that would be great.
We only choose the UseCookieAuthentication because it was similar to FormsAuthentication but we are not opposed to using Claims Authentication if we could find out how.
Working by adding
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
I would recommend ClaimsIdentity instead of trying to pass around cookies. That way you can "register" the web application with the WebAPI application.
I'm assuming by the description that the web app and the WebAPI app are on different domains or at least different virtual directories on the server. If so, you'll probably want to take a look at CORS as well.
Here are a few relevant articles:
http://www.jayway.com/2014/09/25/securing-asp-net-web-api-endpoints-using-owin-oauth-2-0-and-claims/
http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api
If the web app is the only consumer of the WebAPI code and they can be hosted on the same server, you may consider just adding the WebAPI code to the web app solution. Then you won't have to worry about CORS.
Is it possible share authentication between Asp.NET web applications and silverlight business application?
Scenario:
When uses logged in on either SL application or Asp.NET application using same browser, I want them to used active authentication. I have seen OpenId authentication can do such, But wondering can asp.net authentication is also able to do such.
Yes the authentication infrastructure can be shared between ASP.Net and SilverLight. If both the sites are under one domain, we can implement the standard authentication using ASP.Net Membership and role provider.
You can then use the WCF Authentication Service to and authorize user. This authentication is is good only for any server side functionality. If you want to authorize on client side (SilverLight) application you need to build your own infrastructure. Role and Membership provider data available can help you in that.
You can host your SL application in ASP.NET page and when somebody comes on this page do authentication. For instance, you can use FormAuthentication on the site, so when you are navigating from some page to page with Silverlight - access will be hovered by very FormAuthentication. OpenId you can use if ASP.NET app and Silverlight on different sites (domains), but if the Silverlight app is hosted on asp.net page you can also authenticate using asp.net infrastructure on server side.
I have few websites based on the WebForms and one based on MVC. All websites have the same settings for forms authentication in web config.
The problem is that once logged in to WebForms website, I have to re-login for MVC websites, but when I log out from MVC website, I am automatically logged out from WebForms websites.
How can I pass information to the MVC website that user was successfully logged in when using WebForms.
Try this article. Essentially, you want single sign on. That is the term to google for.
http://www.codeproject.com/KB/aspnet/SingleSignon.aspx