|
23 | 23 | import org.elasticsearch.xpack.core.security.authc.Realm;
|
24 | 24 | import org.elasticsearch.xpack.core.security.authc.RealmConfig;
|
25 | 25 | import org.elasticsearch.xpack.core.security.authc.oidc.OpenIdConnectRealmSettings;
|
26 |
| -import org.elasticsearch.xpack.core.security.authc.saml.SamlRealmSettings; |
27 | 26 | import org.elasticsearch.xpack.core.security.authc.support.DelegatedAuthorizationSettings;
|
28 | 27 | import org.elasticsearch.xpack.core.security.user.User;
|
29 | 28 | import org.elasticsearch.xpack.security.authc.support.MockLookupRealm;
|
@@ -87,7 +86,9 @@ public void testAuthentication() throws Exception {
|
87 | 86 | assertThat( result. getUser(). email(), equalTo( "[email protected]"));
|
88 | 87 | assertThat(result.getUser().fullName(), equalTo("Clinton Barton"));
|
89 | 88 | assertThat(result.getUser().roles(), arrayContainingInAnyOrder("kibana_user", "role1"));
|
90 |
| - if (notPopulateMetadata == false) { |
| 89 | + if (notPopulateMetadata) { |
| 90 | + assertThat(result.getUser().metadata().size(), equalTo(0)); |
| 91 | + } else { |
91 | 92 | assertThat(result.getUser().metadata().get("oidc(iss)"), equalTo("https://op.company.org"));
|
92 | 93 | assertThat(result.getUser().metadata().get("oidc(name)"), equalTo("Clinton Barton"));
|
93 | 94 | }
|
@@ -308,7 +309,7 @@ private AuthenticationResult authenticateWithOidc(String principal, UserRoleMapp
|
308 | 309 |
|
309 | 310 | final Settings.Builder builder = getBasicRealmSettings();
|
310 | 311 | if (notPopulateMetadata) {
|
311 |
| - builder.put(getFullSettingKey(REALM_NAME, SamlRealmSettings.POPULATE_USER_METADATA), |
| 312 | + builder.put(getFullSettingKey(REALM_NAME, OpenIdConnectRealmSettings.POPULATE_USER_METADATA), |
312 | 313 | false);
|
313 | 314 | }
|
314 | 315 | if (useAuthorizingRealm) {
|
|
0 commit comments