Authentication and authorization + Asp.net Web + AngularJS API + Windows Authentication + Login Form + User tables of users and roles

Planning the implementation of token authentication for the angularjs and webapi project, we plan to develop an internal enterprise application.

We have a requirement to implement authentication, which will work on

  • Windows authentication when accessing from a network (internal network)
  • and display the registration form when accessing from an external network.

We have user and role tables in the SQL database. we need to authenticate against Active Directory, but use user information and role information from the SQL database.

Here is the plan I have in mind

  • Check source of request
  • If internal use System.UserName and get user and role information from SQL db
  • If you have an external registration form for logging in, allow the user to enter a username and password. Verify Active Directory using the username and password you entered. If success gets the common name from the active directory and uses it to get information about the user and roles from SQL db.

How can we implement token-based authentication for angularjs and webapi applications?

+4
source share

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


All Articles