You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Click on "LS LOGIN" under "Login with credentials"
Perform login at the configured OIDC Identity Provider
When redirected back to the sda-auth service, this message is shown: Authentication failed. You may need to clear your session cookies and try again.
The error message is misleading because sda-auth actually set the state cookie before redirecting to the OIDC Identity Provider but the browser discards it as it has the Secure property set, which means that the cookie can be accepted only if it came over an HTTPS connection.
Expected behavior
sda-auth does not set the Secure property for the state cookie when the redirect URL does not have https:// as prefix.
sda-auth sets the Secure property for the state cookie when the redirect URL has https:// as prefix (retain existing desired behaviour).
OIDC-based login to sda-auth over http (non-secure) protocol is possible.
Tests verifying the fix are added
Additional context
This is where the state cookie is declared with the Secure property:
It could use the redirect URI to check if the destination URL has https:// prefix before setting the Secure property to true.
In contrast, sda-api configuration supports the scenario where cookies might work over non-https connection: api.session.secure property. However, I think sda-auth does not need an extra configuration property for this, as the redirect URI should be sufficient to determine whether Secure cookies are supported.
Estimation of size: small
Estimation of priority: medium
(It is not critical as production environments operate over https anyway. It is not low priority as it blocks local testing and possibly confuses other users who might stumble on this problem.)
The text was updated successfully, but these errors were encountered:
Describe the bug
OIDC login fails when SDA deployment is working over non-https protocol.
Steps to reproduce
Assuming there is no TLS certificate (no values for
server.cert
andserver.key
) configured for sda-auth:The error message is misleading because sda-auth actually set the
state
cookie before redirecting to the OIDC Identity Provider but the browser discards it as it has theSecure
property set, which means that the cookie can be accepted only if it came over an HTTPS connection.Expected behavior
Secure
property for thestate
cookie when the redirect URL does not havehttps://
as prefix.Secure
property for thestate
cookie when the redirect URL hashttps://
as prefix (retain existing desired behaviour).http
(non-secure) protocol is possible.Additional context
This is where the
state
cookie is declared with theSecure
property:sensitive-data-archive/sda/cmd/auth/main.go
Line 223 in b5adfd1
It could use the redirect URI to check if the destination URL has
https://
prefix before setting theSecure
property totrue
.In contrast, sda-api configuration supports the scenario where cookies might work over non-https connection:
api.session.secure
property. However, I think sda-auth does not need an extra configuration property for this, as the redirect URI should be sufficient to determine whetherSecure
cookies are supported.Estimation of size: small
Estimation of priority: medium
(It is not critical as production environments operate over
https
anyway. It is not low priority as it blocks local testing and possibly confuses other users who might stumble on this problem.)The text was updated successfully, but these errors were encountered: