Sarthak Patel

Sarthak Patel

  • NA
  • 45
  • 839

Authentication in ASP.NET MVC 5 application using ASP.NET id

May 13 2020 4:33 AM
How can I authenticate a user when I am using owin middleware in my ASP.NET MVC5 .NET 4.6 application? I don't need to check for the role or authorization part for my method. I just like to verify that current user is authenticated or not ?I am very confused as I have seen the examples in Microsoft docs and other website but there is no any specific example for authentication when using the owin and identity. they are just using the authorize attribute and passing role to verify user. or is there any custom way to achieve authentication when using the owing and identity in ASP.NET MVC
 
i haven't implemented owin middle ware by my side, it's default solution that Microsoft gives. i have just created MVC project by selecting individual user authentication option.I found that when place on any method authorize attribute it authenticate user and redirect to login page. Even i am confused that when i pass any role in Authorize attribute it will check for that role so. How Authentication and authorization is managed by the one Authorize attribute?How actually it works?  

Answers (3)