SAML SSO login flow new registration screen is sometimes not shown
Summary
This happens intermittently - When group managed accounts are enabled, any new user that tries to access the group via the group's url should be shown the new user registration screen after logging in via the IDP. This sometimes does not happen and the user is shown the login screen with message "You need to sign in or sign up before continuing"
Steps to reproduce
- Enable group managed accounts for a group.
- Logout of GitLab and try to access the group directly via the group's url
- Click the "Sign in with Single Sign-On" button
- Enter credentials on the IDP
This could be reproduced by running the qa/qa/specs/features/ee/browser_ui/1_manage/group/group_saml_group_managed_accounts_spec.rb
spec a few times.
What is the current bug behavior?
The user is shown a login screen with the message "You need to sign in or sign up before continuing"
What is the expected correct behavior?
The user should be shown a registration screen with message "<group_name> uses group managed accounts. You need to create a new GitLab account which will be managed by <group_name>"
Relevant logs and/or screenshots
Workaround
If a user lands on a screen that says, "You need to sign in or sign up before continuing" they can click the browser back button until they are on the page that has "Sign in with Single Sign-on" button:
They can then click the "Sign in with Single Sign-on" button to proceed.