Skip to content

Update SAML buttons to pajamas

Alexander Turinske requested to merge 417860-update-buttons into master

What does this MR do and why?

Update SAML buttons to pajamas

  • update saml_link method to return button or link

Changelog: changed

EE: true

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Page Before After
http://gdk.test:3443/groups/gitlab-org/-/saml verify_before verify_after
http://gdk.test:3443/groups/gitlab-org/-/saml/sso all_before Screenshot_2023-07-20_at_17.06.23

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

For https://gdk.test:3443/groups/gitlab-org/-/saml

  1. Follow the gdk docs to set up saml (not that bad)
  2. Navigate to https://gdk.test:3443/groups/gitlab-org/-/saml
  3. For the Identity provider single sign-on URL field enter https://localhost:8443/simplesaml/saml2/idp/SSOService.php
  4. For the Certificate fingerprint field enter 119b9e027959cdb7c662cfd075d9e2ef384e445f
  5. Save the configuration
  6. Toggle the Enable SAML authentication for this group checkbox. The Verify SAML Configuration button should be come disabled

For https://gdk.test:3443/groups/gitlab-org/-/saml/sso

  1. Follow the gdk docs to set up saml (not that bad)
  2. Navigate to http://gdk.test:3443/groups/gitlab-org/-/saml/sso
  3. Apply the below patch to view both saml_links on the page
diff --git a/ee/app/views/groups/sso/saml.html.haml b/ee/app/views/groups/sso/saml.html.haml
index 57f5f3f6e290..3ef5143b0ec6 100644
--- a/ee/app/views/groups/sso/saml.html.haml
+++ b/ee/app/views/groups/sso/saml.html.haml
@@ -16,6 +16,7 @@
           - c.with_body do
             = s_('SAML|To allow %{strongOpen}%{group_name}%{strongClose} to manage your GitLab account %{strongOpen}%{username}%{strongClose} (%{email}) after you sign in successfully using single sign-on, select %{strongOpen}Authorize%{strongClose}.').html_safe % { strongOpen: '<strong>'.html_safe, group_name: @group_name, strongClose: '</strong>'.html_safe, username: current_user.username, email: current_user.email }
         = saml_button _('Authorize'), @group_path, variant: :confirm, block: true, data: { qa_selector: 'saml_sso_signin_button' }
+        = saml_link _('Sign in with single sign-on'), @group_path
       - else
         - button_text = _('Sign in')
         #js-saml-authorize{ data: group_saml_sign_in(group: @group, group_name: @group_name, group_path: @group_path, redirect: @redirect_path, sign_in_button_text: button_text) }
  1. Refresh the page

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 #417860 (closed)

Edited by Alexander Turinske

Merge request reports