Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT Expiry #103

Open
sergiomercado19 opened this issue Aug 26, 2020 · 1 comment
Open

JWT Expiry #103

sergiomercado19 opened this issue Aug 26, 2020 · 1 comment

Comments

@sergiomercado19
Copy link
Contributor

sergiomercado19 commented Aug 26, 2020

A JWT consists of 3 sections: header, payload and signature. These can be observed in the JWT itself where they are separated by dots: <header>.<payload>.<signature>

The JWT payload has an expiry field that holds an epoch timestamp. Our current JWT is set to expire on the 2020-11-25 at 3:38pm (AEST). Since this is a development JWT it is fine to reset it manually, but once we deploy the JWT expiry should be set dynamically.

Resetting process

  1. Find the JWT in backend/server/constants.go. It is the string after Bearer in the AUTH_TOKEN constant.
  2. Copy it into https://jwt.io/
  3. Place the JWT_SECRET in the signature section of the this tool.
  4. Put the epoch time of the new expiry timestamp you wish to set in the exp field of the JWT payload.
  5. After the Encoded token updates, copy it over to constants.go and replace the old JWT.
@abiramen abiramen linked a pull request Sep 7, 2020 that will close this issue
@abiramen abiramen removed a link to a pull request Sep 7, 2020
@glebme
Copy link
Contributor

glebme commented Dec 19, 2020

@sergiomercado19 this needs to be updated with new information regarding the .env file for both local and github actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants