当前位置: 首页>>代码示例>>Java>>正文


Java StepConfig.getAuthenticatorList方法代码示例

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


在下文中一共展示了StepConfig.getAuthenticatorList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleResponse

import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
protected void handleResponse(HttpServletRequest request, HttpServletResponse response,
                              AuthenticationContext context) throws FrameworkException {

    if (log.isDebugEnabled()) {
        log.debug("Receive a response from the external party");
    }

    SequenceConfig sequenceConfig = context.getSequenceConfig();
    int currentStep = context.getCurrentStep();
    boolean isNoneCanHandle = true;
    StepConfig stepConfig = sequenceConfig.getStepMap().get(currentStep);

    for (AuthenticatorConfig authenticatorConfig : stepConfig.getAuthenticatorList()) {
        ApplicationAuthenticator authenticator = authenticatorConfig
                .getApplicationAuthenticator();

        // Call authenticate if canHandle
        if (authenticator != null && authenticator.canHandle(request)
            && (context.getCurrentAuthenticator() == null || authenticator.getName()
                .equals(context.getCurrentAuthenticator()))) {
            isNoneCanHandle = false;

            if (log.isDebugEnabled()) {
                log.debug(authenticator.getName() + " can handle the request.");
            }

            doAuthentication(request, response, context, authenticatorConfig);
            break;
        }
    }
    if (isNoneCanHandle) {
        throw new FrameworkException("No authenticator can handle the request in step :  " + currentStep);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:35,代码来源:DefaultStepHandler.java

示例2: getStepIdPs

import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
public static List<String> getStepIdPs(StepConfig stepConfig) {

        List<String> stepIdps = new ArrayList<String>();
        List<AuthenticatorConfig> authenticatorConfigs = stepConfig.getAuthenticatorList();

        for (AuthenticatorConfig authenticatorConfig : authenticatorConfigs) {
            List<String> authenticatorIdps = authenticatorConfig.getIdpNames();

            for (String authenticatorIdp : authenticatorIdps) {
                stepIdps.add(authenticatorIdp);
            }
        }

        return stepIdps;
    }
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:16,代码来源:FrameworkUtils.java

示例3: getAuthenticatedStepIdPs

import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
public static Map<String, AuthenticatorConfig> getAuthenticatedStepIdPs(StepConfig stepConfig,
                                                                        Map<String, AuthenticatedIdPData> authenticatedIdPs) {

    if (log.isDebugEnabled()) {
        log.debug("Finding already authenticated IdPs of the Step");
    }

    Map<String, AuthenticatorConfig> idpAuthenticatorMap = new HashMap<String, AuthenticatorConfig>();
    List<AuthenticatorConfig> authenticatorConfigs = stepConfig.getAuthenticatorList();

    if (authenticatedIdPs != null && !authenticatedIdPs.isEmpty()) {

        for (AuthenticatorConfig authenticatorConfig : authenticatorConfigs) {
            List<String> authenticatorIdps = authenticatorConfig.getIdpNames();

            for (String authenticatorIdp : authenticatorIdps) {
                AuthenticatedIdPData authenticatedIdPData = authenticatedIdPs
                        .get(authenticatorIdp);

                if (authenticatedIdPData != null
                    && authenticatedIdPData.getIdpName().equals(authenticatorIdp)) {
                    idpAuthenticatorMap.put(authenticatorIdp, authenticatorConfig);
                    break;
                }
            }
        }
    }

    return idpAuthenticatorMap;
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:31,代码来源:FrameworkUtils.java

示例4: handleRequestFromLoginPage

import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
protected void handleRequestFromLoginPage(HttpServletRequest request,
                                          HttpServletResponse response, AuthenticationContext context)
        throws FrameworkException {

    if (log.isDebugEnabled()) {
        log.debug("Relieved a request from the multi option page");
    }

    SequenceConfig sequenceConfig = context.getSequenceConfig();
    int currentStep = context.getCurrentStep();
    StepConfig stepConfig = sequenceConfig.getStepMap().get(currentStep);

    // if request from the login page with a selected IdP
    String selectedIdp = request.getParameter(FrameworkConstants.RequestParams.IDP);

    if (selectedIdp != null) {

        if (log.isDebugEnabled()) {
            log.debug("User has selected IdP: " + selectedIdp);
        }

        try {
            ExternalIdPConfig externalIdPConfig = ConfigurationFacade.getInstance()
                .getIdPConfigByName(selectedIdp, context.getTenantDomain());
            // TODO [IMPORTANT] validate the idp is inside the step.
            context.setExternalIdP(externalIdPConfig);
        } catch (IdentityProviderManagementException e) {
            log.error("Exception while getting IdP by name", e);
        }
    }

    for (AuthenticatorConfig authenticatorConfig : stepConfig.getAuthenticatorList()) {
        ApplicationAuthenticator authenticator = authenticatorConfig
                .getApplicationAuthenticator();
        // TODO [IMPORTANT] validate the authenticator is inside the step.
        if (authenticator != null && authenticator.getName().equalsIgnoreCase(
                request.getParameter(FrameworkConstants.RequestParams.AUTHENTICATOR))) {
            doAuthentication(request, response, context, authenticatorConfig);
            return;
        }
    }

    // TODO handle idp null

    // TODO handle authenticator name unmatching
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:47,代码来源:DefaultStepHandler.java

示例5: getAuthenticatedStepIdPs

import org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig; //导入方法依赖的package包/类
public static Map<String, AuthenticatorConfig> getAuthenticatedStepIdPs(StepConfig stepConfig,
                                                                        Map<String, AuthenticatedIdPData> authenticatedIdPs) {

    if (log.isDebugEnabled()) {
        log.debug(String.format("Finding already authenticated IdPs of the step {order:%d}",
                stepConfig.getOrder()));
    }

    Map<String, AuthenticatorConfig> idpAuthenticatorMap = new HashMap<String, AuthenticatorConfig>();
    List<AuthenticatorConfig> authenticatorConfigs = stepConfig.getAuthenticatorList();

    if (authenticatedIdPs != null && !authenticatedIdPs.isEmpty()) {

        for (AuthenticatorConfig authenticatorConfig : authenticatorConfigs) {

            if (log.isDebugEnabled()) {
                log.debug(String.format("Considering the authenticator '%s'", authenticatorConfig.getName()));
            }

            String authenticatorName = authenticatorConfig.getName();
            List<String> authenticatorIdps = authenticatorConfig.getIdpNames();
            if (log.isDebugEnabled()) {
                log.debug(String.format("%d IdP(s) found in the step.", authenticatedIdPs.size()));
            }

            for (String authenticatorIdp : authenticatorIdps) {

                if (log.isDebugEnabled()) {
                    log.debug(String.format("Considering the IDP : '%s'", authenticatorIdp));
                }

                AuthenticatedIdPData authenticatedIdPData = authenticatedIdPs.get(authenticatorIdp);

                if (authenticatedIdPData != null && authenticatedIdPData.getIdpName() !=  null &&
                        authenticatedIdPData.getIdpName().equals(authenticatorIdp)) {

                    if (FrameworkConstants.LOCAL.equals(authenticatedIdPData.getIdpName())) {
                        if (authenticatedIdPData.isAlreadyAuthenticatedUsing(authenticatorName)) {
                            idpAuthenticatorMap.put(authenticatorIdp, authenticatorConfig);

                            if (log.isDebugEnabled()) {
                                log.debug(String.format("('%s', '%s') is an already authenticated " +
                                        "IDP - authenticator combination.",
                                        authenticatorConfig.getName(), authenticatorIdp));
                            }

                            break;
                        } else {
                            if (log.isDebugEnabled()) {
                                log.debug(String.format("('%s', '%s') is not an already authenticated " +
                                        "IDP - authenticator combination.",
                                        authenticatorConfig.getName(), authenticatorIdp));
                            }
                        }
                    } else {

                        if (log.isDebugEnabled()) {
                            log.debug(String.format("'%s' is an already authenticated IDP.", authenticatorIdp));
                        }

                        idpAuthenticatorMap.put(authenticatorIdp, authenticatorConfig);
                        break;
                    }
                } else {
                    if (log.isDebugEnabled()) {
                        log.debug(String.format("'%s' is NOT an already authenticated IDP.", authenticatorIdp));
                    }
                }
            }
        }
    } else {
        if (log.isDebugEnabled()) {
            log.debug("No authenticators found.");
        }
    }

    return idpAuthenticatorMap;
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:79,代码来源:FrameworkUtils.java


注:本文中的org.wso2.carbon.identity.application.authentication.framework.config.model.StepConfig.getAuthenticatorList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。