简体   繁体   中英

token based authentication web api

I am developing a Xamarin app, and a web API (web service) to connect my app with sql server db. I have a table for storing user credentials in my existing db, and now i want to implement token based authentication, so the user puts username and password in the client xamarin app and the web API generates a token for this user if the credentials exists in this db, so use can access this API by this token. Can this db be used for validating user credentials or there is a new db (identity) the is created for this purpose? am i misunderstanding something?

you can use numbers of ways, my favorite is Mixing JWT/OAuth and ASP.NET Identity 2.1, here is an example . And of course esiprogrammer's Article is very handy, here is another example on that.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM