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

Support clock drift in Omniauth SAML provider #15511

Merged
merged 1 commit into from
Jan 8, 2021
Merged

Support clock drift in Omniauth SAML provider #15511

merged 1 commit into from
Jan 8, 2021

Conversation

kaiyou
Copy link
Contributor

@kaiyou kaiyou commented Jan 7, 2021

Currently, if the SP and IDP are a couple seconds apart, authentication will fail due to the SAML assertion being either too old, or received too early by the SP. This is a common issue with any signature-based authentication scheme (including X509 certificates, and in our case, SAML). When the issue is very sensitive due to short signature lifetime, the verifier may have some configurable tolerance to avoid suffering from clock skew.

The setting is not well documented by the Omniauth SAML provider, but allows for clock skew between SP and IDP, see:
https://github.com/omniauth/omniauth-saml/blob/master/spec/omniauth/strategies/saml_spec.rb

This PR simply exposes this setting as an environment variable for Mastodon, allowing for Mastodon and the IDP to survive clock skew when using SAML.

The setting is not well documented by the provider, but allows for
clock skew between SP and IDP, see:
https://github.com/omniauth/omniauth-saml/blob/master/spec/omniauth/strategies/saml_spec.rb
@Gargron Gargron merged commit f47c177 into mastodon:master Jan 8, 2021
ClearlyClaire pushed a commit to ClearlyClaire/mastodon that referenced this pull request Jan 28, 2022
The setting is not well documented by the provider, but allows for
clock skew between SP and IDP, see:
https://github.com/omniauth/omniauth-saml/blob/master/spec/omniauth/strategies/saml_spec.rb

Co-authored-by: kaiyou <dev@kaiyou.fr>
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.

2 participants