Skip to content

Show error in case of an unkown essential acr claim. Make sure correc…#10088

Merged
mposolda merged 3 commits intokeycloak:mainfrom
mposolda:acr-fixes-2-rebase
Feb 15, 2022
Merged

Show error in case of an unkown essential acr claim. Make sure correc…#10088
mposolda merged 3 commits intokeycloak:mainfrom
mposolda:acr-fixes-2-rebase

Conversation

@mposolda
Copy link
Copy Markdown
Contributor

@mposolda mposolda commented Feb 9, 2022

…t acr is set after authentication flow during step-up authentication

Closes #8724

Co-authored-by: Cornelia Lahnsteiner [email protected]

…t acr is set after authentication flow during step-up authentication

Closes keycloak#8724

Co-authored-by: Cornelia Lahnsteiner <[email protected]>
@mposolda mposolda self-assigned this Feb 9, 2022
@mposolda mposolda added team/core-features area/authentication Indicates an issue on Authentication area labels Feb 9, 2022
@mposolda
Copy link
Copy Markdown
Contributor Author

mposolda commented Feb 10, 2022

@CorneliaLahnsteiner @romgeFYI. I sent discussion with some ideas for improvements / changes to step-up authentication. It is here #10120 . Your feedback is welcome! (I am adding it here even if this discussion is not strictly related to this PR. For future feedback regarding the discussion, please comment in the discussion.)

@CorneliaLahnsteiner
Copy link
Copy Markdown
Contributor

@mposolda Thanks for the information. I will definitely look at the ideas for improvements/changes next week (quite a lot going on this week unfortunately)! I already have a few on my list to add.

private final AuthenticationProcessor processor;
private final AuthenticationFlowModel flow;
private boolean successful;
private boolean successful = false;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I suggest Boolean.FALSE?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm... I am not sure if it is better to use Boolean.FALSE ? This would mean one more necessity for auto-boxing from Boolean object (Boolean.FALSE) to primitive value false. And the successful is a primitive variable, which is not sent anywhere and not parsed from/to String etc and hence is completely fine with stick only to primitive value (true/false) IMO without need of any boxing/unboxing from/to Java object of type Boolean? IMO best for performance and also readability.

Or do you have some article or resource, which recommends to not use primitive for such use-case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems fine to me, just following some guides to avoid constants. But not any problem or technical need.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarification. I consider constants makes sense especially for strings and numbers. Also for example when I want to specify for example default value or when I want to search for the usage. Pretty much most of the use-cases like used for example in class org.keycloak.models.Constants . For this particular use-case, I don't see much value of using Boolean.FALSE instead of false . But thanks for bringing this.

marcelomrwin
marcelomrwin previously approved these changes Feb 11, 2022
Copy link
Copy Markdown
Contributor

@marcelomrwin marcelomrwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me

@mposolda
Copy link
Copy Markdown
Contributor Author

@mabartos @marcelomrwin Thanks for the review and feedback on this!

@mposolda mposolda merged commit 90d4e58 into keycloak:main Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/authentication Indicates an issue on Authentication area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown essential acr claim does not result in an error

4 participants