nextcloud / nextcloud/user_saml
Users with uppercase letters in backend issue: Auto provisioning not allowed and user steve@mail.com does not exist
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 104
- Forks
- 85
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 16
Description
Steps to reproduce
- Configure Nextcloud 15 with LDAP (ActiveDirectory) and SAML (Azure AD, SAML Plugin is configured with user must exist in backend)
- Azure is configured to convert username as lowercase
- In local AD i have user with mixed names, some are lowercase (no issues) and some have uppercase letters (fail)
- user with UserName is listed under users with upper- &lowercase username < this user was synched from ldap backend
Expected behaviour
Login with lowercase username should be possible
Actual behaviour
- user tries to login directly (bypassing SAML) using ldap: this works with UserName and username
- user tries to login via SAML:
- azureAD converts UserName > username
- SAML plugin looks up in backend and sees UserName
- LogIn failed: Auto provisioning not allowed and user Username@domain-name.com does not exist
Server configuration
Operating system: Ubuntu 18.04
Web server: Apache2
Database: MySQL
PHP version: PHP7.3 or PHP7.2
Nextcloud version: 15.0.0
List of activated apps:
- accessibility: 1.1.0
- activity: 2.8.2
- admin_audit: 1.5.0
- announcementcenter: 3.4.0
- audioplayer: 2.5.0
- bruteforcesettings: 1.3.0
- calendar: 1.6.4
- cloud_federation_api: 0.1.0
- comments: 1.5.0
- contacts: 3.0.0
- dav: 1.8.0
- deck: 0.5.1
- encryption: 2.3.0
- federatedfilesharing: 1.5.0
- federation: 1.5.0
- files: 1.10.0
- files_external: 1.6.0
- files_pdfviewer: 1.4.0
- files_sharing: 1.7.0
- files_texteditor: 2.7.0
- files_trashbin: 1.5.0
- files_versions: 1.8.0
- files_videoplayer: 1.4.0
- firstrunwizard: 2.4.0
- gallery: 18.2.0
- logreader: 2.0.0
- lookup_server_connector: 1.3.0
- nextcloud_announcements: 1.4.0
- notes: 2.5.1
- notifications: 2.3.0
- oauth2: 1.3.0
- password_policy: 1.5.0
- provisioning_api: 1.5.0
- serverinfo: 1.5.0
- sharebymail: 1.5.0
- sharepoint: 1.3.0
- spreed: 5.0.0
- support: 1.0.0
- survey_client: 1.3.0
- systemtags: 1.5.0
- tasks: 0.9.8
- theming: 1.6.0
- twofactor_backupcodes: 1.4.1
- updatenotification: 1.5.0
- user_ldap: 1.5.0
- user_saml: 2.1.0
- workflowengine: 1.5.0
Disabled:
- user_external
Nextcloud configuration:
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"nextcloud.supermegaduper-hosting.com"
],
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"overwrite.cli.url": "https:\/\/nextcloud.supermegaduper-hosting.com\/",
"dbtype": "mysql",
"version": "15.0.0.10",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"logtimezone": "UTC",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"appstore.experimental.enabled": "true",
"mail_smtpmode": "smtp",
"mail_smtpauth": 1,
"mail_smtpport": "587",
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "tls",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"preview_libreoffice_path": "\/usr\/bin\/libreoffice",
"filelocking.enabled": true,
"\/\/memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.local": "\\OC\\Memcache\\APCu",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0,
"timeout": 0,
"dbindex": 0,
"password": "***REMOVED SENSITIVE VALUE***"
},
"htaccess.RewriteBase": "\/",
"mysql.utf8mb4": true,
"maintenance": false,
"theme": "",
"loglevel": 2,
"ldapIgnoreNamingRules": false,
"ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
"ldapUserCleanupInterval": 10,
"updater.secret": "***REMOVED SENSITIVE VALUE***",
"updater.release.channel": "stable"
}
}
Any idea how I can avoid renaming all AD accounts to lowercase?
Disabling Azure AD conversion of usernames to lowercase is not an option, because it also fails if in AzureAD the name is UserName and in LDAP the name username.... So there must be away to make SAML Plugin backend checks none-case sensitive.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the SAML plugin's backend user lookup for the lowercase username described in the reproduction, alongside the LDAP configuration and the user_saml and user_ldap apps listed. Reproduce the Azure AD and ActiveDirectory case mismatch, then verify that an existing mixed-case LDAP user is accepted without enabling auto-provisioning.】【。}
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100