Adjust JWT and SAML fetch-and-update user to save new attributes (#23005)
* Adjust JWT and SAML fetch-and-update user to save new attributes Before this change, JWT/SAML logins would attempt to update attributes, but never considered the first-name or last-name attributes. * Attempts to fix tests to prevent pulluting test users with "Unknown" * No deleting users. * Unit tests checking that first/last names are updated for SSO users When an SSO user is first logged in, they might not have first_name and/or last_name keys. This is allowed, but the names will be "Unknown" in the app-db. Subsequently, a User may log in again with SSO but have fisrt/last name attributes, which should update the Metabase user data in the app-db. These unit tests set up such a scenario to check that the :first_name and :last_name keys are indeed updated. * Adjust Enterprise LDAP to also use SSO-UTILS Trying to unify the LDAP implementation with JWT/SAML a bit here. * Lint error * Reverting LDAP ns changes to get the PR unstuck This is to keep the ball rolling on SSO fixes. I'll add LDAP as an item in the Epic to address this separately.
Showing
- enterprise/backend/src/metabase_enterprise/sso/integrations/jwt.clj 11 additions, 8 deletions.../backend/src/metabase_enterprise/sso/integrations/jwt.clj
- enterprise/backend/src/metabase_enterprise/sso/integrations/saml.clj 12 additions, 10 deletions...backend/src/metabase_enterprise/sso/integrations/saml.clj
- enterprise/backend/src/metabase_enterprise/sso/integrations/sso_utils.clj 12 additions, 8 deletions...nd/src/metabase_enterprise/sso/integrations/sso_utils.clj
- enterprise/backend/test/metabase_enterprise/sso/integrations/jwt_test.clj 52 additions, 5 deletions...nd/test/metabase_enterprise/sso/integrations/jwt_test.clj
- enterprise/backend/test/metabase_enterprise/sso/integrations/saml_test.clj 45 additions, 2 deletions...d/test/metabase_enterprise/sso/integrations/saml_test.clj
- test_resources/saml-test-response-new-user-no-names.xml 87 additions, 0 deletionstest_resources/saml-test-response-new-user-no-names.xml
Loading
Please register or sign in to comment