Skip to content

Commit

Permalink
Update APIs to support custom authentication management.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thisara-Welmilla committed Dec 2, 2024
1 parent b959007 commit 0f82231
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public ApplicationAuthenticatorService getApplicationAuthenticatorService() {
*
* @param applicationAuthenticatorService ApplicationAuthenticatorService.
*/
public void setApplicationCommonService(ApplicationAuthenticatorService applicationAuthenticatorService) {
public void setApplicationAuthenticatorService(ApplicationAuthenticatorService applicationAuthenticatorService) {

AuthenticatorsServiceHolder.getInstance().applicationAuthenticatorService = applicationAuthenticatorService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig;
import org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig;
import org.wso2.carbon.identity.application.common.model.UserDefinedLocalAuthenticatorConfig;
import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants;
import org.wso2.carbon.identity.base.AuthenticatorPropertyConstants.DefinedByType;
import org.wso2.carbon.identity.base.IdentityException;
import org.wso2.carbon.identity.core.model.ExpressionNode;
Expand Down Expand Up @@ -214,8 +213,7 @@ public Authenticator addUserDefinedLocalAuthenticator(
UserDefinedLocalAuthenticatorConfig createdConfig = AuthenticatorsServiceHolder.getInstance()
.getApplicationAuthenticatorService().addUserDefinedLocalAuthenticator(
LocalAuthenticatorConfigBuilderFactory.build(config),
AuthenticatorPropertyConstants.AuthenticationType.valueOf(config.getAuthenticationType()
.toString()), CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
return LocalAuthenticatorConfigBuilderFactory.build(createdConfig);
} catch (AuthenticatorMgtException e) {
throw handleAuthenticatorException(e, Constants.ErrorMessage
Expand All @@ -231,8 +229,9 @@ public Authenticator addUserDefinedLocalAuthenticator(
public void deleteUserDefinedLocalAuthenticator(String authenticatorId) {

try {
AuthenticatorsServiceHolder.getInstance().getApplicationAuthenticatorService().deleteUserDefinedLocalAuthenticator(
authenticatorId, CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
AuthenticatorsServiceHolder.getInstance().getApplicationAuthenticatorService()
.deleteUserDefinedLocalAuthenticator(authenticatorId,
CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
} catch (AuthenticatorMgtException e) {
throw handleAuthenticatorException(e, Constants.ErrorMessage.ERROR_CODE_ERROR_RETRIEVING_IDP_CONNECTED_APPS,
authenticatorId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public static UserDefinedLocalAuthenticatorConfig build(UserDefinedLocalAuthenti
UserDefinedLocalAuthenticatorConfig authConfig = new UserDefinedLocalAuthenticatorConfig(
AuthenticatorPropertyConstants.AuthenticationType.valueOf(
config.getAuthenticationType().toString()));
authConfig.setAuthenticationType(AuthenticatorPropertyConstants.AuthenticationType.valueOf(
config.getAuthenticationType().toString()));
authConfig.setName(config.getName());
authConfig.setDisplayName(config.getDisplayName());
authConfig.setEnabled(config.getIsEnabled());
Expand Down

0 comments on commit 0f82231

Please sign in to comment.