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

fix: Add same expiration date that header_payload to signature cookie #540

Merged
merged 3 commits into from
Nov 21, 2022

Conversation

Milouu
Copy link
Contributor

@Milouu Milouu commented Nov 17, 2022

Description

Access token in Substra is secured by separating the cookie in 2 cookies: header_payload and signature. The header_payload cookie has a 24h expiration date but the signature had none. Because of this once the header_payload expired there was a bug as the signature was still existing which blocked the creation of a new pair of cookies (be it from the refresh token or entering credentials again), which led to the user having to delete the signature cookie manually to resolve the issue.
This fix only give the same expiration date to the signature cookie so that it disappears at the same time as header_payload. If the user still has a refresh token (1 week expiration date), a new header_payload-signature pair will be fetched automatically, otherwise credentials have to be entered anew.

How has this been tested?

Checklist

  • changelog was updated with notable changes
  • documentation was updated

@Milouu Milouu force-pushed the fix/signature-cookie-exp branch from a3a79ca to 70f2623 Compare November 17, 2022 16:12
@Milouu Milouu changed the title 🐛 Add same expiration date that header_payload to signature cookie fix:Add same expiration date that header_payload to signature cookie Nov 17, 2022
@Milouu Milouu changed the title fix:Add same expiration date that header_payload to signature cookie fix: Add same expiration date that header_payload to signature cookie Nov 17, 2022
@Milouu Milouu force-pushed the fix/signature-cookie-exp branch from 70f2623 to ded607d Compare November 17, 2022 16:16
@sergebouchut2
Copy link
Contributor

I am not sure to understand why having different dates results in a bug but I think this was defined as is on purpose. See https://github.com/Substra/substra-backend/blob/main/docs/authentication.md#jwt-cookie

Milouu and others added 2 commits November 21, 2022 14:30
Signed-off-by: Milouu <[email protected]>
Signed-off-by: ThibaultFy <[email protected]>
@Milouu Milouu merged commit e3a93e4 into main Nov 21, 2022
@Milouu Milouu deleted the fix/signature-cookie-exp branch November 21, 2022 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants