Skip to content

Commit

Permalink
Add new DefinedBy property to authenticator config.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Sep 19, 2024
1 parent b40fb77 commit 6b20122
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
import org.wso2.carbon.identity.application.common.model.Property;
import org.wso2.carbon.identity.application.common.model.ServiceProvider;
import org.wso2.carbon.identity.application.mgt.ApplicationConstants;
import org.wso2.carbon.identity.base.IdentityConstants;
import org.wso2.carbon.identity.base.IdentityException;
import org.wso2.carbon.identity.base.IdentityRuntimeException;
import org.wso2.carbon.identity.central.log.mgt.utils.LoggerUtils;
Expand Down Expand Up @@ -4190,4 +4191,23 @@ public static boolean isURLRelative(String uriString) throws URISyntaxException

return !new URI(uriString).isAbsolute();
}

/**
* This method return defined by type for the given authenticator name.
*
* @param authenticatorName Name of the authenticator.
* @return The defined by type.
* @throws FrameworkException If no authenticator found for the given authenticator name.
*/
public static IdentityConstants.DefinedByType getAuthenticatorDefinedByType(String authenticatorName)
throws FrameworkException {

for (ApplicationAuthenticator authenticator: FrameworkServiceComponent.getAuthenticators()) {
if (authenticator.getName().equals(authenticatorName)) {
return authenticator.getDefinedByType();
}
}

throw new FrameworkException("No authenticator instance is found for " + authenticatorName);
}
}

0 comments on commit 6b20122

Please sign in to comment.