Skip to content

Renew Access Token using Refresh Token #99

@jay-dee7

Description

@jay-dee7

We're using JSON Web Tokens for Authentication so far and planning to use it for embedding Authorisation flow as well.

A common pattern with JWTs is to have a short-lived Access Token(like an hour), and use use a Refresh Token to renew the Access Token when the token lifecycle ends. This isn't some crazy security benefit (since JWTs are not meant to be used like this) but this way, at least, we're reducing the surface of the possible attack.

The Goal for this issue would be to add a /auth/refresh handler, which takes a refresh token, processes it and returns an expected response. The following would be enough to make it useful:

  • If the refresh token is expired, handler must return HTTP Status 401 - Unauthorised
  • If the token is valid, return a HTTP Status 200 - OK response, and a cookie with Access Token as the value of the cookie (exactly like Sign In and Login With Github Methods)

Here are some good starting off points:

Metadata

Metadata

Assignees

Labels

P2P2 labels are used for significant features, improvements, etc

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions