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

Changes to getAMR() method #2736

Draft
wants to merge 5 commits into
base: feature-amr
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4206,6 +4206,21 @@ private void associateAuthenticationHistory(SessionDataCacheEntry resultFromLogi
*/
private List<String> getAMRValues(List<String> authMethods, Map<String, AuthenticatedIdPData> authenticatedIdPs) {

boolean authenticatorAMREnabled = true;
if (authenticatorAMREnabled) {
Comment on lines +4209 to +4210
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the variable is hardcoded to true the if statement is redundant.

List<String> resultantAuthMethods = new ArrayList<>();
for (Map.Entry<String, AuthenticatedIdPData> entry : authenticatedIdPs.entrySet()) {
if (entry.getValue() != null && entry.getValue().getAuthenticators() != null) {
for (AuthenticatorConfig authenticatorConfig : entry.getValue().getAuthenticators()) {
if (authenticatorConfig != null && authenticatorConfig.getAmrValue() != null) {
resultantAuthMethods.addAll(Arrays.asList(authenticatorConfig.getAmrValue()));
}
}
}
}
return resultantAuthMethods;
}

boolean readAMRValueFromIdp = Boolean.parseBoolean(IdentityUtil.getProperty(
OAuthConstants.READ_AMR_VALUE_FROM_IDP));
if (readAMRValueFromIdp) {
Expand Down
Loading