Skip to content

Enable SSO and ensure trial registrations perform onboarding steps

Doug Stull requested to merge 404926-add-sso-onboarding-specs into master

What does this MR do and why?

Let SSO sign ups experience the new user onboarding as we have this on normal sign ups for growth reasons in SaaS and want to add to the SSO experience as well. Before, due to the verification loop, the user is dropped out of the onboarding loop. This MR will address

  • users dropping out of the onboarding loop during verification or by simply navigating away to another page
  • intention to start a trial being dropped
  • users not completing onboarding in general for SSO

This will also address trial registrations through regular signup being able to exit the specific trial onboarding and defaulting back to non-trial on welcome page redirection.

This should not affect Group Saml, LDAP or other Oauth strategies. Only the social sign ons for SaaS.

This feature is behind the ensure_onboarding feature flag.

Screenshots or screen recordings

SSO

  • before sso trial registration, toggle for trial seen(wrong)

Screen_Recording_2023-05-08_at_2.01.35_PM

  • after in sso trial registration, toggle not seen and wording is correct

Screen_Recording_2023-05-08_at_2.14.12_PM

Regular

  • before trial registration, toggle for trial seen(wrong)

Screen_Recording_2023-05-09_at_3.33.22_PM

  • after in trial registration, toggle not seen and wording is correct

Screen_Recording_2023-05-09_at_3.28.58_PM

How to set up and validate locally

note basically trying to emulate feature spec steps in ee/spec/features/registrations/saas/standard_flow_just_me_creating_project_spec.rb

  1. Setup to simulate SaaS and restart GDK
    • Make sure Admin > Settings > General > Sign Up Restrictions match the below (no admin approval, but hard email confirmation) image
  2. Enable ensure onboarding feature flag and check_namespace_plan in rails console
    • Feature.enable(:ensure_onboarding)
    • ApplicationSetting.first.update(check_namespace_plan: true)
  3. Sign up for non SSO(fill in user name and password) with trial(with /-/trial_registrations/new path) and notice differences in screenshots above.
  4. Confirm email by finding the confirmation path from last User created in rails console
    • Rails.application.routes.url_helpers.user_confirmation_path(confirmation_token: User.last.confirmation_token)
  5. Sign up for SSO(user github or google)
    • set your development gitlab.yml config values - mine looked like the below, setup for github by going on github under developer settings for my profile, redacted my info:
development:
  <<: *base
  omniauth:
    block_auto_created_users: false
    allow_single_sign_on: true
    providers:
    - { name: 'google_oauth2',
        app_id: '',
        app_secret: '',
        args: { access_type: 'offline', approval_prompt: '' } }
    - { name: 'github',
        app_id: 'xxxx',
        app_secret: 'xxxxx',
        args: { scope: "user:email" } }
  1. sign in by clicking the sign in button the trial page for the SSO provider(with /-/trial_registrations/new path) and notice differences in screenshots above.
  2. Validate when on welcome page/almost there that you can redirect to root path and it will redirect you back correctly, staying in the trial.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #404926

Edited by Doug Stull

Merge request reports