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

User without restricted-access role is being able to authenticate. #224

Closed
1 task done
KhasDenis opened this issue Dec 5, 2023 · 10 comments
Closed
1 task done
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@KhasDenis
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

User without restricted-access role is still being able to authenticate. Role itself created both in realm and client (In both cases there is 0 assignments). My current configuration is similar to this one https://user-images.githubusercontent.com/12183470/136276665-6b087651-baa9-43aa-addf-59db247529b7.png

Screenshot 2023-12-05 at 13 18 35 Screenshot 2023-12-05 at 13 25 01 Screenshot 2023-12-05 at 13 25 43 Screenshot 2023-12-05 at 13 27 35

Expected Behavior

User without restricted-access role is not being able to authenticate.

Steps To Reproduce

No response

Version

- Keycloak: 22.0.4
- This extension: 22.0.0

Anything else?

No response

@KhasDenis KhasDenis added the bug Something isn't working label Dec 5, 2023
@sventorben
Copy link
Owner

@KhasDenis If I see it correctly, you have mixed required and alternative flows on the same level which is not supported by Keycloak.
Try to make "Copy of browser forms 2" an alternative like the other ones and it should work.

@KhasDenis
Copy link
Author

Still being able to authenticate.
Screenshot 2023-12-05 at 15 25 26

I was seeing issue with required and alternate on the same level before and usually it is in the logs something like
2023-12-05 12:10:41,478 WARN [org.keycloak.authentication.DefaultAuthenticationFlow] (executor-thread-208) REQUIRED and ALTERNATIVE elements at same level! Those alternative executions will be ignored: [auth-cookie] 2023-12-05 12:10:41,479 WARN [org.keycloak.services] (executor-thread-208) KC-SERVICES0013: Failed authentication: org.keycloak.authentication.AuthenticationFlowException

with the config I shared earlier there were no complains in the log.

@sventorben
Copy link
Owner

Can you show me the roles that you have configured for the client to which you set the authentication flow override, please?

@KhasDenis
Copy link
Author

Screenshot 2023-12-05 at 16 25 49

@sventorben
Copy link
Owner

That looks ok. Can you export the full realm configuration and post the file here? I think that I need to see all the details to investigate this further.

@KhasDenis
Copy link
Author

realm-export.json

@KhasDenis
Copy link
Author

If in "Copy of browser" flow I add explicit "Deny Access" right before "Restrict user authentication on client" I'm still able to authenticate. If I move "Deny Access" as a first step then I'm not able to authenticate.

Also as another test I created the same flow but with my js authenticator the same story.

So problem seems to be somewhere in the flow itself, but I don't see anything in the logs.

@KhasDenis
Copy link
Author

So it is basically this issue keycloak/keycloak#10250

@sventorben
Copy link
Owner

@sventorben sventorben self-assigned this Jan 2, 2024
@sventorben sventorben added the invalid This doesn't seem right label Jan 2, 2024
@sventorben
Copy link
Owner

Closing this issue, because this behaviour is caused by Keycloak itself and not by this extension.
It can be resolved by properly configuring post login flows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants