WS-FED Authentication (ADFS) and ASP.NET Identity UserManager

I apologize if I use incorrect or ambiguous terms. Please correct me if I do this.

I have a fairly new ASP.NET 4.6 MVC 5 application that uses Claims authentication through the WsFederation server and Microsoft ADFS . This means that I do not detect the LogIn action controller, nor do I manage the users and passwords in my webapp. When a user goes to my site, if they are not authenticated, they are redirected to the ADFS server, where they log in, and then redirected back.

I need to save some of my claims for offline use - their display name and email address. My thought was to use the ASP.NET Identity package, which creates os tables AspNet*. In my opinion, it is designed to support both local users (with passwords) and external users (with passwords managed externally) from vendors such as Facebook, Google, Github, etc. Will I fix ADFS falling under this category?

And after successful authentication, it is redirected back to my site, where exactly do I put the logic, which checks whether the user has an entry in the tables AspNet*? The configuration and connection of cookie authentication and WsFederation currently occurs in the method Startup.ConfigureAuth(IAppBuilder app). I think I should use classes that inherit from IdentityUserand IdentityDbContext<ApplicationUser>, and then call methods on UserManageror UserStore.

I spent hours searching for examples of how to connect external logins to the "profile" tables of the application to no avail. It is very possible that I used the wrong terms. Each example that I have found so far concerns either emulation or changing the default VS template, which comes with login and registration methods or just connecting FB and Google. Nothing related to binding ADFS and / or to profile tables from external sources.

Any code samples or at least links to articles / resources are welcome.

+4
source share
1 answer

Source: https://habr.com/ru/post/1626284/


All Articles