AngularJS Authentication with JWT(JSON web tokens)
JWTs provide a way for clients to authenticate every request without having to maintain a session or repeatedly pass login credentials to the server. A JWT consists of three main components: a header object, a claims object, and a signature. These three properties are encoded using base64, then concatenated with periods as separators. Some important things to know about JWT's:
The claims object contains an expiration date which dictates how long the token is valid for
The claims object can also contain custom bits of information such as a user ID
The token is NOT encrypted so anyone with it can read all the properties
The token IS signed by the server so if any of the values are changed, the server will reject it
JWTs provide a way for clients to authenticate every request without having to maintain a session or repeatedly pass login credentials to the server. A JWT consists of three main components: a header object, a claims object, and a signature. These three properties are encoded using base64, then concatenated with periods as separators. Some important things to know about JWT's:
The claims object contains an expiration date which dictates how long the token is valid for
The claims object can also contain custom bits of information such as a user ID
The token is NOT encrypted so anyone with it can read all the properties
The token IS signed by the server so if any of the values are changed, the server will reject it
0 comments:
Post a Comment