本文整理汇总了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;
}
示例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;
}