-
Notifications
You must be signed in to change notification settings - Fork 1.3k
The client secret in the database will become {bcrypt} secret when login. #1337
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
Comments
Hi @Waylon-Firework! 👋 So I'll start with a little bit of a primer as to the feature that you're coming across here. Similar to the password upgrades that Spring Security users have come to know for end user accounts, this provides the same mechanisms for upgrading the security of the OAuth client credentials themselves. The framework uses the current encoding and strength, if applicable, to determine if the source secret that we have just confirmed is correct is in need of being upgraded. Upgraded in this context may mean changing the underlying encoding entirely or increasing the strength of the current algorithm. The way that this is triggered is by the current configured implementation of Based upon what you have presented here so far, this leads me to know that the presently available If you don't want for this to happen, in what I hope is your demo/testing app, then you just need to configure your application with the |
Thank you @shanman190 . I added the {noop} password encoder and it works as expected. But I feel that this update behavior should not be the default. Because it makes our key a secret. We will have to find its original value from the sql backup. Wouldn't it be better if it could be turned on with a configuration? |
Anyway, it does come in handy for users who need to upgrade their security. However, it happened too suddenly. 😄 |
Would you mind expressing how this feature in particular is causing you an issue? From an authentication standpoint, the same secret will still be used to authenticate and would result in a successful authentication. |
@shanman190 Sure. We have some external customers, we generate client_id, client_secret and limit scope for them. Customers can log in to our system, and they can see the client secret we generated for them from the page. Of course, to view it, they need to verify the email verification code. Currently, the client secret stored in the database becomes a {bcrypt} secret when we upgrade the spring authorization server version. This prevents them from viewing the original client secret. Moreover, as a server, we also cannot see the original secret when we upgrade the spring authorization server version, because {bcrypt} is difficult to crack. We will have to restore them from historical mysql data. |
@shanman190 |
So the password encoder can be configured separately for just for the OAuth piece presently via: Line 128 in e5fcbe4
Line 157 in e5fcbe4
Personally for the other part, the use case really sounds more like the OIDC Dynamic Client registration flow which provides back the client secret on the response itself. This enables secure storage without compromising on the feature of being able to show the user the secret one time. |
Thank you @shanman190 . That's great. |
Step 1: register a client with {noop} secret.
mysql database

Step 2: login with oauth flow, the client secret in the database will become {bcrypt} secret.
http://localhost:9000/oauth2/authorize?response_type=code&client_id=message-client&scope=openid%20profile%20message.read&state=some-state&redirect_uri=http://127.0.0.1:8080/authorized
mysql database

The text was updated successfully, but these errors were encountered: