SAML/SCIM API :uid parameter unable to handle periods
Summary
Related to #98354, customers are unable to update SAML/SCIM extern_uid
via API when the current value includes a period. e.g. value is an email
Steps to reproduce
- Assign an identity to a user that includes a period
- Make a PATCH request to the
groups/:groups_id/saml/:uid
endpoint to update the users identity
What is the current bug behavior?
Due to the period, it is unable to find the identity and errors out with a 404.
What is the expected correct behavior?
Successful response showing the updated extern_uid
and user_id
Relevant logs and/or screenshots
Unsuccessful with period:
curl --location --request PATCH "https://gitlab.com/api/v4/groups/58946864/saml/test+test@gitlab.com" --header 'PRIVATE-TOKEN: token' --form 'extern_uid=test'
{"message":"404 Identity Not Found"}
Successful without period:
curl --location --request PATCH "https://gitlab.com/api/v4/groups/58946864/saml/test+test@gitlabcom" --header 'PRIVATE-TOKEN: token' --form 'extern_uid=test'
{"extern_uid":"test","user_id":8278845}
Possible fixes
https://gitlab.com/gitlab-org/gitlab/-/blob/master/ee/lib/api/provider_identity.rb#L45
Edited by Jio Castillo