How to manipulate the ClaimsIdentity of current token using middleware in .net core app?
I have a middleware to use in development mode like following.
I have a middleware to use in development mode like following.
In my ASP.NET Core MVC project, I have this scenario: a manager can do anything in the web application, you can call it super manager, and there is only one user. This “super” manager can add other managers that are more restricted, for example these managers cannot create users of type manager, or cannot see some information.
I am developing an MVC 5 web application using Entity Framework 5 Database First approach. I am using OWIN for the authentication of Users. Below shows my Login method within my Account Controller.
In a Web API project I am overriding the normal authentication process to check tokens instead. The code looks something like this:
I have an application that used to use FormsAuthentication, and a while ago I switched it to use the IdentityModel from WindowsIdentityFramework so that I could benefit from claims based authentication, but it was rather ugly to use and implement. So now I’m looking at OwinAuthentication.
Please I need assistance in implementing a custom way of assigning claims to authenticated users.
On successful login,
I am trying to retrieve some custom claims that I made when I created my token. However, I am not sure on what I should write to retrieve those claims.
Looked up everywhere but looks like I am stuck right now. I am using Windows Active Directory in my application for authentication.
For authorization, I am using claims. After searching through the limited .net core documentation, this is how my code looks like.
When a user access a website and enters their credentials which are stored in our database, we when create an authentication.