use of org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService in project carbon-identity-framework by wso2.
the class ApplicationManagementServiceImplTest method testGetAllRequestPathAuthenticators.
@Test
public void testGetAllRequestPathAuthenticators() throws IdentityApplicationManagementException {
ApplicationAuthenticatorService appAuthenticatorService = ApplicationAuthenticatorService.getInstance();
RequestPathAuthenticatorConfig requestPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
appAuthenticatorService.addRequestPathAuthenticator(requestPathAuthenticatorConfig);
RequestPathAuthenticatorConfig[] requestPathAuthenticatorConfigs = applicationManagementService.getAllRequestPathAuthenticators(SUPER_TENANT_DOMAIN_NAME);
Assert.assertEquals(requestPathAuthenticatorConfigs[0], requestPathAuthenticatorConfig);
}
use of org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService in project carbon-identity-framework by wso2.
the class FrameworkServiceComponent method unsetAuthenticator.
protected void unsetAuthenticator(ApplicationAuthenticator authenticator) {
FrameworkServiceDataHolder.getInstance().getAuthenticators().remove(authenticator);
String authenticatorName = authenticator.getName();
ApplicationAuthenticatorService appAuthenticatorService = ApplicationAuthenticatorService.getInstance();
if (authenticator instanceof LocalApplicationAuthenticator) {
LocalAuthenticatorConfig localAuthenticatorConfig = appAuthenticatorService.getLocalAuthenticatorByName(authenticatorName);
appAuthenticatorService.removeLocalAuthenticator(localAuthenticatorConfig);
} else if (authenticator instanceof FederatedApplicationAuthenticator) {
FederatedAuthenticatorConfig federatedAuthenticatorConfig = appAuthenticatorService.getFederatedAuthenticatorByName(authenticatorName);
appAuthenticatorService.removeFederatedAuthenticator(federatedAuthenticatorConfig);
} else if (authenticator instanceof RequestPathApplicationAuthenticator) {
RequestPathAuthenticatorConfig reqPathAuthenticatorConfig = appAuthenticatorService.getRequestPathAuthenticatorByName(authenticatorName);
appAuthenticatorService.removeRequestPathAuthenticator(reqPathAuthenticatorConfig);
}
if (log.isDebugEnabled()) {
log.debug("Removed application authenticator : " + authenticator.getName());
}
}
use of org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService in project carbon-identity-framework by wso2.
the class ApplicationManagementServiceImplTest method testGetAllLocalAuthenticators.
@Test
public void testGetAllLocalAuthenticators() throws IdentityApplicationManagementException {
ApplicationAuthenticatorService appAuthenticatorService = ApplicationAuthenticatorService.getInstance();
LocalAuthenticatorConfig localAuthenticatorConfig = new LocalAuthenticatorConfig();
appAuthenticatorService.addLocalAuthenticator(localAuthenticatorConfig);
LocalAuthenticatorConfig[] localAuthenticatorConfigs = applicationManagementService.getAllLocalAuthenticators(SUPER_TENANT_DOMAIN_NAME);
Assert.assertEquals(localAuthenticatorConfigs[0], localAuthenticatorConfig);
}
Aggregations