本文整理汇总了Java中io.undertow.security.api.AuthenticationMode类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationMode类的具体用法?Java AuthenticationMode怎么用?Java AuthenticationMode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationMode类属于io.undertow.security.api包,在下文中一共展示了AuthenticationMode类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: authTransitionRequired
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
private boolean authTransitionRequired() {
switch (authenticationState) {
case NOT_ATTEMPTED:
// There has been no attempt to authenticate the current request so do so either if required or if we are set to
// be pro-active.
return authenticationRequired || authenticationMode == AuthenticationMode.PRO_ACTIVE;
case ATTEMPTED:
// To be ATTEMPTED we know it was not AUTHENTICATED so if it is required we need to transition to send the
// challenges.
return authenticationRequired;
default:
// At this point the state would either be AUTHENTICATED or CHALLENGE_SENT - either of which mean no further
// transitions applicable for this request.
return false;
}
}
示例2: enableAuthUDICustomizer
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
private UndertowDeploymentInfoCustomizer enableAuthUDICustomizer() {
return (DeploymentInfo di) -> {
if(StringUtils.isEmpty(encodedPass)) {
return;
}
SecurityConstraint sc = new SecurityConstraint();
sc.setEmptyRoleSemantic(SecurityInfo.EmptyRoleSemantic.AUTHENTICATE);
// empty web resource interpret as default
sc.addWebResourceCollection(new WebResourceCollection());
di.addSecurityConstraints(sc);
di.setSecurityDisabled(false);
di.setAuthenticationMode(AuthenticationMode.PRO_ACTIVE);
di.setLoginConfig(new LoginConfig(HttpServletRequest.BASIC_AUTH, "Haven Agent"));
di.setIdentityManager(new IdentityManagerImpl(encodedPass));
};
}
示例3: SecurityInitialHandler
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
public SecurityInitialHandler(final AuthenticationMode authenticationMode, final IdentityManager identityManager,
final String programaticMechName, final SecurityContextFactory contextFactory, final HttpHandler next) {
this.authenticationMode = authenticationMode;
this.identityManager = identityManager;
this.programaticMechName = programaticMechName;
this.contextFactory = contextFactory;
this.next = next;
}
示例4: SecurityContextImpl
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
public SecurityContextImpl(final HttpServerExchange exchange, final AuthenticationMode authenticationMode, final IdentityManager identityManager) {
this.authenticationMode = authenticationMode;
this.identityManager = identityManager;
this.exchange = exchange;
if (System.getSecurityManager() != null) {
System.getSecurityManager().checkPermission(PERMISSION);
}
}
示例5: createSecurityContext
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
@Override
public SecurityContext createSecurityContext(final HttpServerExchange exchange, final AuthenticationMode mode,
final IdentityManager identityManager, final String programmaticMechName) {
SecurityContextImpl securityContext = SecurityActions.createSecurityContextImpl(exchange, mode, identityManager);
if (programmaticMechName != null)
securityContext.setProgramaticMechName(programmaticMechName);
return securityContext;
}
示例6: createSecurityContextImpl
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
static SecurityContextImpl createSecurityContextImpl(final HttpServerExchange exchange, final AuthenticationMode authenticationMode, final IdentityManager identityManager) {
if (System.getSecurityManager() == null) {
return new SecurityContextImpl(exchange, authenticationMode, identityManager);
} else {
return AccessController.doPrivileged(new PrivilegedAction<SecurityContextImpl>() {
@Override
public SecurityContextImpl run() {
return new SecurityContextImpl(exchange, authenticationMode, identityManager);
}
});
}
}
示例7: SecurityInitialHandler
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
public SecurityInitialHandler(final AuthenticationMode authenticationMode, final IdentityManager identityManager,
final String programaticMechName,
final io.undertow.security.api.SecurityContextFactory contextFactory,
final PipedHttpHandler next) {
super(next);
this.authenticationMode = authenticationMode;
this.identityManager = identityManager;
this.programaticMechName = programaticMechName;
this.contextFactory = contextFactory;
}
示例8: buildSecurityHandlerChain
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
protected static PipedHttpHandler buildSecurityHandlerChain(
PipedHttpHandler next,
final AccessManager accessManager,
final IdentityManager identityManager,
final List<AuthenticationMechanism> mechanisms) {
PipedHttpHandler handler;
if (accessManager == null) {
throw new IllegalArgumentException("Error, accessManager cannot "
+ "be null. "
+ "Eventually use FullAccessManager "
+ "that gives full access power ");
}
handler = new AuthTokenInjecterHandler(
new AccessManagerHandler(accessManager, next));
handler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE,
identityManager,
new AuthenticationMechanismsHandler(
new AuthenticationConstraintHandler(
new AuthenticationCallHandler(handler),
accessManager),
mechanisms));
return handler;
}
示例9: setAuthenticationMode
import io.undertow.security.api.AuthenticationMode; //导入依赖的package包/类
public LoginConfig setAuthenticationMode(final AuthenticationMode authenticationMode) {
this.authenticationMode = authenticationMode;
return this;
}