Search in sources :

Example 1 with ApplicationAuthenticatorService

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);
}
Also used : ApplicationAuthenticatorService(org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService) RequestPathAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig) Test(org.testng.annotations.Test)

Example 2 with ApplicationAuthenticatorService

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());
    }
}
Also used : ApplicationAuthenticatorService(org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService) FederatedAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig) RequestPathApplicationAuthenticator(org.wso2.carbon.identity.application.authentication.framework.RequestPathApplicationAuthenticator) LocalAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig) RequestPathAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig) LocalApplicationAuthenticator(org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator) FederatedApplicationAuthenticator(org.wso2.carbon.identity.application.authentication.framework.FederatedApplicationAuthenticator)

Example 3 with ApplicationAuthenticatorService

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);
}
Also used : ApplicationAuthenticatorService(org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService) LocalAuthenticatorConfig(org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig) Test(org.testng.annotations.Test)

Aggregations

ApplicationAuthenticatorService (org.wso2.carbon.identity.application.common.ApplicationAuthenticatorService)3 Test (org.testng.annotations.Test)2 LocalAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.LocalAuthenticatorConfig)2 RequestPathAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.RequestPathAuthenticatorConfig)2 FederatedApplicationAuthenticator (org.wso2.carbon.identity.application.authentication.framework.FederatedApplicationAuthenticator)1 LocalApplicationAuthenticator (org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator)1 RequestPathApplicationAuthenticator (org.wso2.carbon.identity.application.authentication.framework.RequestPathApplicationAuthenticator)1 FederatedAuthenticatorConfig (org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig)1