Skip to content

Commit

Permalink
Add tags in the idp authenticator responses.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Dec 10, 2024
1 parent a25fe0f commit 097f431
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,27 @@ public static FederatedAuthenticator build(FederatedAuthenticatorConfig config)
federatedAuthenticator.setName(config.getName());
federatedAuthenticator.setIsEnabled(config.isEnabled());

FederatedAuthenticatorConfig federatedAuthenticatorConfig =
ApplicationAuthenticatorService.getInstance().getFederatedAuthenticatorByName(
config.getName());
if (federatedAuthenticatorConfig != null) {
String[] tags = federatedAuthenticatorConfig.getTags();
if (ArrayUtils.isNotEmpty(tags)) {
federatedAuthenticator.setTags(Arrays.asList(tags));
}
}

String[] tags = config.getTags();
if (DefinedByType.SYSTEM == config.getDefinedByType()) {
federatedAuthenticator.setDefinedBy(FederatedAuthenticator.DefinedByEnum.SYSTEM);
List<org.wso2.carbon.identity.api.server.idp.v1.model.Property> properties =
Arrays.stream(config.getProperties()).map(propertyToExternal).collect(Collectors.toList());
federatedAuthenticator.setProperties(properties);

FederatedAuthenticatorConfig federatedAuthenticatorConfig =
ApplicationAuthenticatorService.getInstance().getFederatedAuthenticatorByName(config.getName());
if (federatedAuthenticatorConfig != null) {
tags = federatedAuthenticatorConfig.getTags();
}
} else {
federatedAuthenticator.setDefinedBy(FederatedAuthenticator.DefinedByEnum.USER);
resolveEndpointConfiguration(federatedAuthenticator, config);
}

if (ArrayUtils.isNotEmpty(tags)) {
federatedAuthenticator.setTags(Arrays.asList(tags));
}

return federatedAuthenticator;
}

Expand Down

0 comments on commit 097f431

Please sign in to comment.