Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create client with empty secret is not possible #2570

Closed
strehle opened this issue Oct 24, 2023 · 3 comments · Fixed by #2574
Closed

Create client with empty secret is not possible #2570

strehle opened this issue Oct 24, 2023 · 3 comments · Fixed by #2574
Labels
accepted Accepted the issue bug
Milestone

Comments

@strehle
Copy link
Member

strehle commented Oct 24, 2023

What version of UAA are you running?

76.22.0

How are you deploying the UAA?

I am deploying the UAA

  • locally only using gradlew
  • using a bosh release I downloaded from bosh.io
  • using cf-release
  • using cf-deployment
  • as part of a commercial Cloud Foundry distribution

What did you do?

uaac client add newclient --name xuaa --scope openid --authorized_grant_types password --autoapprove true --secret ''

error response:
{
"error": "invalid_client",
"error_description": "Client Secret must be at least 1 characters in length."
}

What did you expect to see? What goal are you trying to achieve with the UAA?

Create a client with an empty secret via REST

What did you see instead?

"Client Secret must be at least 1 characters in length."

The client secret policy by default allow a min length of 0 but in
https://github.com/cloudfoundry/uaa/blob/develop/server/src/main/java/org/cloudfoundry/identity/uaa/util/PasswordValidatorUtil.java#L55
This is prevented because this code "thinks" it runs for user passwords

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/186321885

The labels on this github issue will be updated when the story is started.

@peterhaochen47
Copy link
Member

peterhaochen47 commented Oct 24, 2023

A similar discrepancy/confusion exists with the user password validation, in the context of uaa-release, where uaa.password.policy.minLength is defaulted to 0, but in reality, UAA does not allow zero-length user password.

But the addition of this "not allow zero-length password" logic seems deliberate based on the original tracker story associated with this restriction. Hence, we should investigate more before we attempt to unify the docs with the actual code. Perhaps the correct approach to eventually resolve this discrepancy is to, in a major release, maintain the API code logic (user/client cred needs to be at least 1 char), correct the docs/uaa-release config, and disallow empty string cred entirely.

@strehle strehle linked a pull request Oct 25, 2023 that will close this issue
This was unlinked from pull requests Oct 25, 2023
@strehle strehle linked a pull request Oct 25, 2023 that will close this issue
@strehle
Copy link
Member Author

strehle commented Oct 25, 2023

A similar discrepancy/confusion exists with the user password validation, in the context of uaa-release, where uaa.password.policy.minLength is defaulted to 0, but in reality, UAA does not allow zero-length user password.

But the addition of this "not allow zero-length password" logic seems deliberate based on the original tracker story associated with this restriction. Hence, we should investigate more before we attempt to unify the docs with the actual code. Perhaps the correct approach to eventually resolve this discrepancy is to, in a major release, maintain the API code logic (user/client cred needs to be at least 1 char), correct the docs/uaa-release config, and disallow empty string cred entirely.

Thanks for referencing further issues here. This issue here will be found via search later on and can also serve for keeping in mind that we need to clarify the documentation and/or code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Accepted the issue bug
Projects
Development

Successfully merging a pull request may close this issue.

3 participants