diff --git a/src/main/java/com/amazon/dlic/auth/http/saml/HTTPSamlAuthenticator.java b/src/main/java/com/amazon/dlic/auth/http/saml/HTTPSamlAuthenticator.java index 6cd933f02e..c07ec8a769 100644 --- a/src/main/java/com/amazon/dlic/auth/http/saml/HTTPSamlAuthenticator.java +++ b/src/main/java/com/amazon/dlic/auth/http/saml/HTTPSamlAuthenticator.java @@ -338,12 +338,12 @@ private Settings createJwtAuthenticatorSettings(Settings settings) { settingsBuilder.put(jwtSettings); - if (jwtSettings.get("roles_key") == null) { - settingsBuilder.put("roles_key", settings.get("roles_key", "roles")); + if (jwtSettings.get("roles_key") == null && settings.get("roles_key") != null) { + settingsBuilder.put("roles_key", "roles"); } if (jwtSettings.get("subject_key") == null) { - settingsBuilder.put("subject_key", settings.get("subject_key", "sub")); + settingsBuilder.put("subject_key", "sub"); } return settingsBuilder.build();