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

JHipster UAA does not work on the master branch #7301

Closed
jdubois opened this issue Mar 15, 2018 · 10 comments
Closed

JHipster UAA does not work on the master branch #7301

jdubois opened this issue Mar 15, 2018 · 10 comments
Assignees
Milestone

Comments

@jdubois
Copy link
Member

jdubois commented Mar 15, 2018

I'm testing the current master branch, which will become JHipster 5 soon.

Doing a simple microservice architecture with JHipster UAA, I'm not redirected to the UAA server, so obviously I'm not correctly authenticated and it fails.

@xetys do you have the time to take a look? It might not be very complex, we didn't touch that part as far as I remember

@xetys
Copy link
Member

xetys commented Mar 15, 2018

seems like it's time to move all my kubernetes/go/bachelor-thesis stuff aside...I'll schedule the next weeks for more JHipster topics as the list is growing..

@xetys xetys self-assigned this Mar 15, 2018
@jdubois
Copy link
Member Author

jdubois commented Mar 15, 2018

I'm sorry about this @xetys - I hope it's not something very complex, I don't understand why there is anything broken here, we're mostly working on React, so the Angular part should work as well as before

@xetys
Copy link
Member

xetys commented Mar 15, 2018

don't feel sorry, you are doing a huge piece of work on v5 and it's obvious that stuff gets broken. I just had a lot of time problems in the past, as of my k8s focus and pending thesis and some private issues...

hard to keep everything in focus, but yeah, I will do that the next days.

@jdubois
Copy link
Member Author

jdubois commented Mar 15, 2018

Oh, but whatever happens, put your private issues first....

@BhawaniSingh
Copy link
Member

I'll look over this weekend.

@BhawaniSingh
Copy link
Member

@jdubois I think I've found the source of issue,

Issue is in UAA

In Spring security 4, in DaoAuthenticationProvider class, PasswordEncoder from package org.springframework.security.authentication.encoding is used, and for matching the password boolean isPasswordValid(String encPass, String rawPass, Object salt); was being used, for requests with Basic Authorization Header salt is null, so the encPass && rawPass is always same (changeit)

But In Spring security 5, in DaoAuthenticationProvider class, PasswordEncoder from package org.springframework.security.crypto.password is used, and for matching the password
boolean matches(CharSequence rawPassword, String encodedPassword); is used, but the value for rawPassword, encodedPassword is same (changeit in our case), but encodedPassword has to be a BcryptString or else it will, this is causing UAA to fail

When I generated the UAA from the latest release (4.14.1) and other part of microservices from the master branch, login was success

Let me know If more detail is required,

Sorry for my bad English

@BhawaniSingh
Copy link
Member

BhawaniSingh commented Mar 16, 2018

To fix this issue, we need to add PasswordEncoder dependency from package org.springframework.security.crypto.password.PasswordEncoder in UaaConfiguration and encode the inMemory Secret.

I've tested it and It works fine. Its too late now (4 AM) I'll create a pull request for the same

@jdubois
Copy link
Member Author

jdubois commented Mar 16, 2018

Oh thanks so much for the detailed analysis!!! Could you do a PR on this?

@BhawaniSingh
Copy link
Member

BhawaniSingh commented Mar 16, 2018 via email

jdubois added a commit that referenced this issue Mar 18, 2018
Fixed JHipster UAA does not work on the master branch #7301
@jdubois
Copy link
Member Author

jdubois commented Mar 18, 2018

Closing as #7310 is merged

@jdubois jdubois added this to the 5.0.0-beta.0 milestone Apr 3, 2018
ruddell added a commit to ruddell/generator-jhipster that referenced this issue Jun 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants