• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java LocalApplicationAuthenticator类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator的典型用法代码示例。如果您正苦于以下问题:Java LocalApplicationAuthenticator类的具体用法?Java LocalApplicationAuthenticator怎么用?Java LocalApplicationAuthenticator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

LocalApplicationAuthenticator类属于org.wso2.carbon.identity.application.authentication.framework包,在下文中一共展示了LocalApplicationAuthenticator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: unsetAuthenticator

点赞 3

import org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator; //导入依赖的package包/类
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());
        }

    }
 

开发者ID:wso2,
项目名称:carbon-identity-framework,
代码行数:26,
代码来源:FrameworkServiceComponent.java

示例2: processFirstStepOnly

点赞 3

import org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator; //导入依赖的package包/类
/**
 * In SMSOTP optional case proceed with first step only.It can be basic or federated.
 *
 * @param authenticatedUser the name of authenticatedUser
 * @param context           the AuthenticationContext
 */
private void processFirstStepOnly(AuthenticatedUser authenticatedUser, AuthenticationContext context) {
    if (log.isDebugEnabled()) {
        log.debug("Processing First step only. Skipping SMSOTP");
    }
    //the authentication flow happens with basic authentication.
    StepConfig stepConfig = context.getSequenceConfig().getStepMap().get(context.getCurrentStep() - 1);
    if (stepConfig.getAuthenticatedAutenticator().getApplicationAuthenticator() instanceof
            LocalApplicationAuthenticator) {
        if (log.isDebugEnabled()) {
            log.debug("Found local authenticator in previous step. Hence setting a local user");
        }
        FederatedAuthenticatorUtil.updateLocalAuthenticatedUserInStepConfig(context, authenticatedUser);
        context.setProperty(SMSOTPConstants.AUTHENTICATION, SMSOTPConstants.BASIC);
    } else {
        if (log.isDebugEnabled()) {
            log.debug("Found federated authenticator in previous step. Hence setting a local user");
        }
        FederatedAuthenticatorUtil.updateAuthenticatedUserInStepConfig(context, authenticatedUser);
        context.setProperty(SMSOTPConstants.AUTHENTICATION, SMSOTPConstants.FEDERETOR);
    }
}
 

开发者ID:wso2-extensions,
项目名称:identity-outbound-auth-sms-otp,
代码行数:28,
代码来源:SMSOTPAuthenticator.java

示例3: getUsername

点赞 3

import org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator; //导入依赖的package包/类
private AuthenticatedUser getUsername(AuthenticationContext context) throws AuthenticationFailedException {
    //username from authentication context.
    AuthenticatedUser authenticatedUser = null;
    for (int i = 1; i <= context.getSequenceConfig().getStepMap().size(); i++) {
        StepConfig stepConfig = context.getSequenceConfig().getStepMap().get(i);
        if (stepConfig.getAuthenticatedUser() != null && stepConfig.getAuthenticatedAutenticator()
                .getApplicationAuthenticator() instanceof LocalApplicationAuthenticator) {
            authenticatedUser = stepConfig.getAuthenticatedUser();
            if (authenticatedUser.getUserStoreDomain() == null) {
                authenticatedUser.setUserStoreDomain(UserCoreConstants.PRIMARY_DEFAULT_DOMAIN_NAME);
            }


            if (log.isDebugEnabled()) {
                log.debug("username :" + authenticatedUser.toString());
            }
            break;
        }
    }
    if(authenticatedUser == null){
        throw new AuthenticationFailedException("Could not locate an authenticated username from previous steps " +
                "of the sequence. Hence cannot continue with FIDO authentication.");
    }
    return authenticatedUser;
}
 

开发者ID:wso2-attic,
项目名称:carbon-identity,
代码行数:26,
代码来源:FIDOAuthenticator.java

示例4: setAuthenticator

点赞 2

import org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator; //导入依赖的package包/类
protected void setAuthenticator(ApplicationAuthenticator authenticator) {

        FrameworkServiceDataHolder.getInstance().getAuthenticators().add(authenticator);

        Property[] configProperties = null;

        if (authenticator.getConfigurationProperties() != null
            && !authenticator.getConfigurationProperties().isEmpty()) {
            configProperties = authenticator.getConfigurationProperties().toArray(new Property[0]);
        }

        if (authenticator instanceof LocalApplicationAuthenticator) {
            LocalAuthenticatorConfig localAuthenticatorConfig = new LocalAuthenticatorConfig();
            localAuthenticatorConfig.setName(authenticator.getName());
            localAuthenticatorConfig.setProperties(configProperties);
            localAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
            ApplicationAuthenticatorService.getInstance().addLocalAuthenticator(localAuthenticatorConfig);
        } else if (authenticator instanceof FederatedApplicationAuthenticator) {
            FederatedAuthenticatorConfig federatedAuthenticatorConfig = new FederatedAuthenticatorConfig();
            federatedAuthenticatorConfig.setName(authenticator.getName());
            federatedAuthenticatorConfig.setProperties(configProperties);
            federatedAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
            ApplicationAuthenticatorService.getInstance().addFederatedAuthenticator(federatedAuthenticatorConfig);
        } else if (authenticator instanceof RequestPathApplicationAuthenticator) {
            RequestPathAuthenticatorConfig reqPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
            reqPathAuthenticatorConfig.setName(authenticator.getName());
            reqPathAuthenticatorConfig.setProperties(configProperties);
            reqPathAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
            ApplicationAuthenticatorService.getInstance().addRequestPathAuthenticator(reqPathAuthenticatorConfig);
        }

        if (log.isDebugEnabled()) {
            log.debug("Added application authenticator : " + authenticator.getName());
        }
    }
 

开发者ID:wso2-attic,
项目名称:carbon-identity,
代码行数:36,
代码来源:FrameworkServiceComponent.java

示例5: setAuthenticator

点赞 2

import org.wso2.carbon.identity.application.authentication.framework.LocalApplicationAuthenticator; //导入依赖的package包/类
@Reference(
        name = "application.authenticator",
        service = ApplicationAuthenticator.class,
        cardinality = ReferenceCardinality.AT_LEAST_ONE,
        policy = ReferencePolicy.DYNAMIC,
        unbind = "unsetAuthenticator"
)
protected void setAuthenticator(ApplicationAuthenticator authenticator) {

    FrameworkServiceDataHolder.getInstance().getAuthenticators().add(authenticator);

    Property[] configProperties = null;

    if (authenticator.getConfigurationProperties() != null
        && !authenticator.getConfigurationProperties().isEmpty()) {
        configProperties = authenticator.getConfigurationProperties().toArray(new Property[0]);
    }

    if (authenticator instanceof LocalApplicationAuthenticator) {
        LocalAuthenticatorConfig localAuthenticatorConfig = new LocalAuthenticatorConfig();
        localAuthenticatorConfig.setName(authenticator.getName());
        localAuthenticatorConfig.setProperties(configProperties);
        localAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
        ApplicationAuthenticatorService.getInstance().addLocalAuthenticator(localAuthenticatorConfig);
    } else if (authenticator instanceof FederatedApplicationAuthenticator) {
        FederatedAuthenticatorConfig federatedAuthenticatorConfig = new FederatedAuthenticatorConfig();
        federatedAuthenticatorConfig.setName(authenticator.getName());
        federatedAuthenticatorConfig.setProperties(configProperties);
        federatedAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
        ApplicationAuthenticatorService.getInstance().addFederatedAuthenticator(federatedAuthenticatorConfig);
    } else if (authenticator instanceof RequestPathApplicationAuthenticator) {
        RequestPathAuthenticatorConfig reqPathAuthenticatorConfig = new RequestPathAuthenticatorConfig();
        reqPathAuthenticatorConfig.setName(authenticator.getName());
        reqPathAuthenticatorConfig.setProperties(configProperties);
        reqPathAuthenticatorConfig.setDisplayName(authenticator.getFriendlyName());
        ApplicationAuthenticatorService.getInstance().addRequestPathAuthenticator(reqPathAuthenticatorConfig);
    }

    if (log.isDebugEnabled()) {
        log.debug("Added application authenticator : " + authenticator.getName());
    }
}
 

开发者ID:wso2,
项目名称:carbon-identity-framework,
代码行数:43,
代码来源:FrameworkServiceComponent.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)