openflighthpc / flight-control

0 stars 0 forks source link

Use SSO token expiry time in the SSO Cookie #33

Closed timalces closed 2 years ago

timalces commented 2 years ago

Aims to resolve #32

The Flight SSO service includes expiration of an authentication_token, currently either 24 hours later for regular sign ins, or 100 years later if 'remember me' is selected. This was missed in the current Control implementation of SSO, so the SSO cookie created by Control had no expiry.

This meant SSO cookies were not getting removed when their tokens were expired. In Flight Center this prevented new log ins (unless manually delete the SSO cookie), and in Control would produce a breaking error.

This PR adds logic to determine the token expiry when querying the Flight SSO service, and use it for the resulting flight_sso cookie's expiry. It also includes logic to pass on the 'remember_me' choice to Flight SSO.

Note: This means SSO users are now automatically logged out from Control when this expiry time is reached.

Implementation detail