简体   繁体   中英

REST API - Authentication vs Authorisation?

I am creating some APIs and I am confused about how my application will authenticate, basically because I feel I need 2 authentications and I cannot find any information about this.

  1. Authentication with the API Server (so my app will be able to retrieve data and sync even if no user is logged in)
  2. Users authentication

Is one endpoint (ie /login ) enough to manage all this?

Any ideas?

Thank you!

In this case, use an HMAC on the incoming request with a preshared key to authenticate the user. Then on your resource (in the Controller), validate that your user is authorized to access the route.

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