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


Java AuthenticationContext.isPassive方法代码示例

本文整理汇总了Java中net.shibboleth.idp.authn.context.AuthenticationContext.isPassive方法的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationContext.isPassive方法的具体用法?Java AuthenticationContext.isPassive怎么用?Java AuthenticationContext.isPassive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.shibboleth.idp.authn.context.AuthenticationContext的用法示例。


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

示例1: getUnattemptedInactiveFlow

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
/**
 * Return the first inactive potential flow not found in the intermediate
 * flows collection that applies to the request.
 * 
 * @param profileRequestContext
 *            the current profile request context
 * @param authenticationContext
 *            the current authentication context
 * @return an eligible flow, or null
 */
@Nullable
private AuthenticationFlowDescriptor getUnattemptedInactiveFlow(
        @Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final AuthenticationContext authenticationContext) {
    for (final AuthenticationFlowDescriptor flow : authenticationContext.getPotentialFlows().values()) {
        if (!authenticationContext.getIntermediateFlows().containsKey(flow.getId())) {
            if (!authenticationContext.isPassive() || flow.isPassiveAuthenticationSupported()) {
                if (flow.apply(profileRequestContext)) {
                    return flow;
                }
            }
        }
    }

    return null;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:27,代码来源:SelectAuthenticationFlow.java

示例2: selectRequestedInactiveFlow

import net.shibboleth.idp.authn.context.AuthenticationContext; //导入方法依赖的package包/类
/**
 * Selects an inactive flow in the presence of specific requested
 * Principals, and completes processing.
 * 
 * @param profileRequestContext
 *            the current IdP profile request context
 * @param authenticationContext
 *            the current authentication context
 */
private boolean selectRequestedInactiveFlow(@Nonnull final ProfileRequestContext profileRequestContext,
        @Nonnull final AuthenticationContext authenticationContext) {

    final Map<String, AuthenticationFlowDescriptor> potentialFlows = authenticationContext.getPotentialFlows();

    // Check each flow for compatibility with request. Don't check for an
    // active result also.
    // Also omit anything in the intermediates collection already.
    for (final Principal p : requestedPrincipalCtx.getRequestedPrincipals()) {
        log.debug("{} Checking for an inactive flow compatible with operator '{}' and principal '{}'",
                getLogPrefix(), requestedPrincipalCtx.getOperator(), p.getName());
        final PrincipalEvalPredicate predicate = requestedPrincipalCtx.getPredicate(p);
        if (predicate != null) {
            for (final AuthenticationFlowDescriptor descriptor : potentialFlows.values()) {
                if (!authenticationContext.getIntermediateFlows().containsKey(descriptor.getId())
                        && predicate.apply(descriptor) && descriptor.apply(profileRequestContext)) {
                    if (!authenticationContext.isPassive() || descriptor.isPassiveAuthenticationSupported()) {
                        selectInactiveFlow(profileRequestContext, authenticationContext, descriptor);
                        return true;
                    }
                }
            }
        } else {
            log.warn("{} Configuration does not support requested principal evaluation with "
                    + "operator '{}' and type '{}'", getLogPrefix(), requestedPrincipalCtx.getOperator(),
                    p.getClass());
        }
    }

    log.info("{} None of the potential authentication flows can satisfy the request", getLogPrefix());
    return false;
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:42,代码来源:SelectAuthenticationFlow.java


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