How do I secure REST API calls?

前端 未结 6 1039
南旧
南旧 2020-11-29 15:51

I\'m developing the restful web app that using some popular web framework on the backend, say (rails, sinatra, flask, express.js). Ideally, I want to develop client side wit

6条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 16:45

    There's an open standard now called "JSON Web Token",

    see https://jwt.io/ & https://en.wikipedia.org/wiki/JSON_Web_Token

    JSON Web Token (JWT) is a JSON-based open standard (RFC 7519) for creating tokens that assert some number of claims. For example, a server could generate a token that has the claim "logged in as admin" and provide that to a client. The client could then use that token to prove that they are logged in as admin. The tokens are signed by the server's key, so the server is able to verify that the token is legitimate. The tokens are designed to be compact, URL-safe and usable especially in web browser single sign-on (SSO) context. JWT claims can be typically used to pass identity of authenticated users between an identity provider and a service provider, or any other type of claims as required by business processes.[1][2] The tokens can also be authenticated and encrypted.[3][4]

提交回复
热议问题