-
Notifications
You must be signed in to change notification settings - Fork 81
Role Mappings dont work with mail-like usernames #56
Comments
@Tetha You can use |
For me, that does not work. If I use
|
@Tetha It should be a bug, I will check that later. |
seems same usecase with #57? |
@josedev-union Can you take a look at your keycloak user objects and provide the pseudomized values of the login property and the email property of your problematic user account? In particular, it would be important to see if the login property of the keycloak username matches the email matcher, and if the email field is the same, or different from the username in that case. |
if email like username used, then KeycloakHttpHeaderAuthToken: false while KeycloakHttpHeaderAuthToken: true with non-email like username |
@Tetha @josedev-union Hi, did you enable the option And you can try to login Keycloak with the email to verify it. |
@flytreeleft that was enabled already for my usecase. |
fyi, i found that if i use "." in the username, it works while i use "@", it does not work. https://github.com/flytreeleft/nexus3-keycloak-plugin/blob/master/src/main/java/org/github/flytreeleft/nexus3/keycloak/plugin/internal/NexusKeycloakClient.java#L49-L56
|
@flytreeleft so as you can see authenticate func in NexusKeycloakClient.java, when we use email-like username, the email verify is the mandatory thing. |
@Tetha so when we use email-like username, the username must be same with email as well as email verification. |
@flytreeleft so i am thinking like this how about your ideas? @Tetha @flytreeleft |
@josedev-union I know what your problem is. We should verify it as a normal username first, then check it as an email when it's fault. By the way, did you login Nexus via SSO authentication? |
yes, with general username, I can login via sso |
@flytreeleft if you allow, i will make a PR |
@josedev-union Thanks for your PR :) |
@josedev-union @Tetha I have released the fixed version 0.4.1-prev1-SNAPSHOT, please have a try :) |
Sure thing, I'll tell the team to update and check. |
Hello,
there is an entirely weird interaction in our setup. Our identity provider is generating keycloak users with usernames like
elmer.fudd@old.example.com
, but different email addresses such aselmer.fudd@new.example.com
.This allows users to authenticate with this plugin, but breaks authorization later on.
As far as I have traced, the bug occurs in this method:
nexus3-keycloak-plugin/src/main/java/org/github/flytreeleft/nexus3/keycloak/plugin/internal/KeycloakAdminClient.java
Line 104 in 648fa03
With a username =
elmer.fudd@old.example.com
, the method will search foremail=elmer.fudd@old.example.com
instead ofusername=elmer.fudd@old.example.com
to get the roles of the user. In the best case, this finds no roles because the mail does not exist. In the worst case, a user might be able to set their username to the email of another user and be authorized with their permissions. In either case, mail-like user names dont work in an expected way.However, I'm entirely unsure how to fix this without breaking either login flow.
The text was updated successfully, but these errors were encountered: