REST API authentication for web app and mobile app

前端 未结 3 1998
生来不讨喜
生来不讨喜 2020-12-07 10:00

I\'m having some trouble deciding how to implement authentication for a RESTful API that will be secure for consumption by both a web app and a mobile app.

Firstly,

3条回答
  •  不知归路
    2020-12-07 10:15

    One way of addressing the issue of user authentication to the API is by requesting an authentication token from the API when the user logs in. This token can then be used for subsequent requests. You've already touched on this approach - it's pretty sound.

    With respect to restricting certain web apps. You'll want to have each web app identify itself with each request and have this authentication carried out inside your API implementation. Pretty straight forward.

提交回复
热议问题