OmniAuth/SAML Logins Fail with notbefore related error
Summary
Previously functional SAML based logins fail with Could not authenticate you from SAML because "Current time is earlier than notbefore condition (2019-03-25 15:57:20 utc < 2019-03-25 15:57:21 utc)".
The times are correct on both the SP and the IDP. Additionally, the SAML response from the IDP does not contain a notbefore or notafter condition.
Some research indicates that the allowed_clock_drift
config option should help with this but I've set it to 5 seconds with no help. For the sake of testing I have set it to 60 seconds also with no help
Steps to reproduce
- Open fresh session and navigate to GLCE instance
- Once redirected to SAML login page log in with correct credentials or be redirected due to previously logging in to something via IDP
- Be given error message:
Could not authenticate you from SAML because "Current time is earlier than notbefore condition (2019-03-25 <current time> utc < 2019-03-25 <current time> utc)".
What is the current bug behavior?
See previous description.
What is the expected correct behavior?
Correct behavior is successfully logging in
Relevant logs and/or screenshots
Processing by SessionsController#new as HTML
Redirected to https://<gitlab_instance>/users/auth/saml
Filter chain halted as :auto_sign_in_with_provider rendered or redirected
Completed 302 Found in 10ms (ActiveRecord: 0.9ms)
Started GET "/users/auth/saml" for <client> at 2019-03-25 11:59:08 -0400
Processing by Gitlab::RequestForgeryProtection::Controller#index as HTML
Completed 200 OK in 0ms (ActiveRecord: 0.0ms)
Started POST "/users/auth/saml" for <client> at 2019-03-25 11:59:09 -0400
Processing by Gitlab::RequestForgeryProtection::Controller#index as HTML
Parameters: {"authenticity_token"=>"[FILTERED]"}
Completed 200 OK in 1ms (ActiveRecord: 0.0ms)
Started POST "/users/auth/saml/callback" for <client> at 2019-03-25 11:59:10 -0400
Processing by OmniauthCallbacksController#failure as HTML
Parameters: {"SAMLResponse"=>"<encrypted response>"}
Redirected to https://<gitlab_instance>/users/sign_in
Completed 302 Found in 7ms (ActiveRecord: 0.0ms)
Started GET "/users/sign_in" for <client> at 2019-03-25 11:59:10 -0400
Processing by SessionsController#new as HTML
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Ubuntu 18.04 Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.5 Go Version: go1.10.4 linux/amd64
GitLab information Version: 11.9.0 Revision: a47124c7852 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: https:// HTTP Clone URL: https:///some-group/some-project.git SSH Clone URL: git@:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers: saml
GitLab Shell Version: 8.7.1 Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.7.1 ? ... OK (8.7.1) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 13/1 ... yes 2/2 ... yes 2/3 ... yes 5/4 ... yes 13/5 ... yes 5/6 ... yes 5/8 ... yes 14/9 ... yes 14/10 ... yes 14/11 ... yes 8/12 ... yes 2/13 ... yes 8/14 ... yes 15/15 ... yes 2/16 ... yes 2/17 ... yes 14/18 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 8
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
Unknown