fix(validation): allow RFC 6749 VSCHAR characters in client_id and client_secret#638
Merged
Merged
Conversation
Co-Authored-By: Oz <oz-agent@warp.dev>
H2CK
requested changes
Apr 7, 2026
Owner
H2CK
left a comment
There was a problem hiding this comment.
Thanks for your contribution. Please have a look at the further comments which are all related to the test execution and solve the problems.
The other changes are in general fine for me.
H2CK
approved these changes
Apr 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
I'm trying to automate OIDC clients provisioning in Nextcloud and hit a wall, took me some time to understand issue. I was generating client id and secrets with the terminal, but realized that the implementation of the oidc plugin is too restrictive. Here is my proposal.
The current validation in
oidc:createandSettingsController.addClient()restrictsclient_idandclient_secretto[A-Za-z0-9]characters only.RFC 6749 (OAuth 2.0) Appendix A https://datatracker.ietf.org/doc/html/rfc6749#appendix-A defines both as
*VSCHAR(any printable ASCII,%x20-7E). The only character that must be excluded is:(colon), which is the Basic auth username/password separator per RFC 7617.The current restriction breaks interoperability with any credential generator that follows standard naming conventions (e.g.
myapp-service, UUIDs, hyphenated identifiers). The failure mode is particularly opaque: the CLI rejects the credential at creation time with a non-obvious error message, and if a credential somehow reaches the token endpoint with a non-alphanumeric character, Nextcloud logs a genericLogin failedwith no indication of the root cause.Changes
lib/Command/Clients/OIDCCreate.phpandlib/Controller/SettingsController.phpfrom/^[A-Za-z0-9]{32,64}$/to VSCHAR minus:and space:/^[\x21-\x39\x3B-\x7E]{32,64}$/-,_,.(should pass) and:(should fail)Impact
No existing credentials are affected - the alphanumeric subset is fully contained within the new character set. The 32-64 length requirement is preserved as a security floor.