wso2 / product-is

Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
748 stars 729 forks source link

User Provisioning using SCIM2/Me endpoint fails when the special character '/ ' is used in the username #4883

Closed ShanikaWickramasinghe closed 2 weeks ago

ShanikaWickramasinghe commented 5 years ago

Suggested Labels Affected : 5.8.0- alpha3 Severity: Major Priority: Critical Component: SCIM2 Type-Bug

Environment Linux, EmbeddedLDAP UserStore

Steps to Reproduce the Issue

  1. Enable SCIM in user-mgt.xml
  2. Set the scim2/Me Resources secured as false in identity.xml as in [1]
  3. Following is the allowed username regex in the embedded ldap config in user-mgt.xml <Property name="UsernameJavaRegEx">[a-zA-Z0-9._\-|//]{3,30}$</Property> 4.Try the sample Request to provision a user anonymously including special characters in the username

curl -v -k --data '{"schemas":[],"name":{"familyName":"Johnson","givenName":"Alex"},"userName":"alex2//ferdinanz","password":"alexwso2","emails":[{"primary":true,"value":"alex.j@gmail.com","type":"home"},{"value":"alex_j@wso2.com","type":"work"}],"EnterpriseUser":{"employeeNumber":"123A","manager":{"value":"Taylor"}}}' --header "Content-Type:application/json" https://is580.qa.com:443/scim2/Me

Will get the following response as saying scim is not enabled. This is a wrong information to the user because SCIM is enabled in the system and the request fails due to the special character. {"schemas":["urn:ietf:params:scim:api:messages:2.0:Error"],"detail":"Cannot add user through scim to user store . SCIM is not enabled for user store ALEX2","status":"500"}

ShanikaWickramasinghe commented 5 years ago

Same issue observed when using both the back slash and forward slash in the username evennthough in the username regex it is mentioned as a allowed character

isharak commented 2 weeks ago

This issue is being closed due to extended inactivity. Please feel free to reopen it if further attention is needed. Thank you for helping us keep the issue list relevant and focused!