Chethan
Chethan

Reputation: 370

Token based authentication in web api

I am developing a web api service which will be consumed by asp.net mvc web application and mobile apps (android and ios). My database and web api will be hosted on same server. I want to implement authentication for web api (token based). My database has a table for storing user credentials. I will have to use this database to validate the credentials when the user logs in.

Came across a few articles which suggest owin and identity server. I am confused on how to proceed and need some help in understanding a better approach.

Upvotes: 1

Views: 1158

Answers (1)

LittleDragon
LittleDragon

Reputation: 2437

you can simply implement the token base authentication

  1. when user is login to the system send the random token code
  2. cash it in the client side
  3. when client side making request to the server send the token with the request header
  4. validate the token and accept request or reject

simple way :)

Upvotes: 1

Related Questions