Base solution for your next web application
Open Closed

Authentication through external API #4472


User avatar
0
dreamsmiths created

We are using the AspNetZero template to create a portal. The only difficult part I cant figure out, is to allow the user to authenticate through an external API, instead of the SQL database. Can you please perhaps give guidance on what is the best way to allow the user to enter their credentials, uses aspnetzero identity server, but then authenticates the username and password through an external API? (The external API call accept a username and password, and return a bool if credentials is correct)

If you do have an example somewhere on how to tackle this, it would be amazing.

We would still want to save information about the user in our AspNetZero database, like permissions etc after the user has logged in as per normal. (but the users password shouldn’t be stored here)

We are using angular, .netcore2, and identity server to allow single sign on ability. Thanks


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @dreamsmiths,

    You can follow a similar approach to LDAP auth. Basically you need to define an external auth source and use it. You can check this document <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Zero/User-Management#external-authentication">https://aspnetboilerplate.com/Pages/Doc ... entication</a>.

    Let us know if you have any problems while implementing it.