本文整理汇总了Java中io.undertow.security.api.AuthenticationMechanism类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationMechanism类的具体用法?Java AuthenticationMechanism怎么用?Java AuthenticationMechanism使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationMechanism类属于io.undertow.security.api包,在下文中一共展示了AuthenticationMechanism类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getSecurityHandlerChain
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
private static PipedHttpHandler getSecurityHandlerChain(final PipedHttpHandler next, AuthenticationMechanism authenticationMechanism, final IdentityManager identityManager, final AccessManager accessManager, final boolean challenging) {
if (identityManager != null) {
final List<AuthenticationMechanism> mechanisms = new ArrayList<>();
if(authenticationMechanism != null){
mechanisms.add(authenticationMechanism);
}
mechanisms.add(new AuthTokenAuthenticationMechanism(RESTHEART_REALM));
if (challenging) {
mechanisms.add(new BasicAuthenticationMechanism(RESTHEART_REALM));
} else {
mechanisms.add(new SilentBasicAuthenticationMechanism(RESTHEART_REALM));
}
return buildSecurityHandlerChain(next, accessManager, identityManager, mechanisms);
} else {
return next;
}
}
开发者ID:SoftInstigate,项目名称:restheart,代码行数:22,代码来源:SecurityHandler.java
示例2: loadAuthenticationMechanism
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
/**
* loadAuthenticationMechanism
*
* @return the AuthenticationMechanism
*/
private static AuthenticationMechanism loadAuthenticationMechanism(final IdentityManager identityManager) {
AuthenticationMechanism authMechanism = null;
if (configuration.getAuthMechanism() != null) {
try {
AuthenticationMechanismFactory am = (AuthenticationMechanismFactory) Class.forName(configuration.getAuthMechanism())
.getConstructor()
.newInstance();
authMechanism = am.build(configuration.getAuthMechanismArgs(), identityManager);
LOGGER.info("Authentication Mechanism {} enabled", configuration.getAuthMechanism());
} catch (ClassNotFoundException
| IllegalAccessException
| IllegalArgumentException
| InstantiationException
| NoSuchMethodException
| SecurityException
| InvocationTargetException ex) {
logErrorAndExit("Error configuring Authentication Mechanism implementation " + configuration.getAuthMechanism(), ex, false, -3);
}
} else {
LOGGER.info("Authentication Mechanism io.undertow.security.impl.BasicAuthenticationMechanism enabled");
}
return authMechanism;
}
开发者ID:SoftInstigate,项目名称:restheart,代码行数:30,代码来源:Bootstrapper.java
示例3: handleRequest
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
final SecurityContext sc = exchange.getSecurityContext();
if(sc != null) {
for(AuthenticationMechanism mechanism : authenticationMechanisms) {
sc.addAuthenticationMechanism(mechanism);
}
}
next.handleRequest(exchange);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:11,代码来源:AuthenticationMechanismsHandler.java
示例4: transition
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
private AuthenticationState transition() {
if (mechanismIterator.hasNext()) {
final AuthenticationMechanism mechanism = mechanismIterator.next();
AuthenticationMechanismOutcome outcome = mechanism.authenticate(exchange, SecurityContextImpl.this);
if (outcome == null) {
throw UndertowMessages.MESSAGES.authMechanismOutcomeNull();
}
switch (outcome) {
case AUTHENTICATED:
// TODO - Should verify that the mechanism did register an authenticated Account.
return AuthenticationState.AUTHENTICATED;
case NOT_AUTHENTICATED:
// A mechanism attempted to authenticate but could not complete, this now means that
// authentication is required and challenges need to be sent.
setAuthenticationRequired();
return AuthenticationState.ATTEMPTED;
case NOT_ATTEMPTED:
// Time to try the next mechanism.
return transition();
default:
throw new IllegalStateException();
}
} else {
// Reached the end of the mechanisms and no mechanism authenticated for us to reach this point.
return AuthenticationState.ATTEMPTED;
}
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:SecurityContextImpl.java
示例5: create
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
// <auth-method>BASIC?silent=true,FORM</auth-method>
// "When adding the mechanism name to the LoginConfig structure it
// is also possible to specify a property map."
String realm = properties.get(REALM);
// String contextPath = properties.get(CONTEXT_PATH);
Optional<Realm> realmProviders = oidc.listRealms().stream().filter(r -> realm.equals(r.getName())).findFirst();
if (realmProviders.isPresent()) {
return new OIDCAuthenticationMechanism(mechanismName, realmProviders.get(), oidc.getContext(), formParserFactory, identityManager);
} else {
throw new RuntimeException(String.format("Unable to find realm configuration for %s", realm));
}
}
开发者ID:aaronanderson,项目名称:swarm-oidc,代码行数:17,代码来源:OIDCAuthenticationMechanism.java
示例6: mechanism
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
private AuthenticationMechanism mechanism(final boolean opera, final boolean digest) {
if (digest) {
return opera ? fakeRealmdigestMechanism : digestMechanism;
} else {
return opera ? fakeRealmBasicMechanism : basicMechanism;
}
}
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:LogoutHandler.java
示例7: buildSecurityHandlerChain
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的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;
}
开发者ID:SoftInstigate,项目名称:restheart,代码行数:28,代码来源:PipedHttpHandler.java
示例8: AuthenticationMechanismsHandler
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
public AuthenticationMechanismsHandler(final HttpHandler next, final List<AuthenticationMechanism> authenticationMechanisms) {
this.next = next;
this.authenticationMechanisms = authenticationMechanisms;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:AuthenticationMechanismsHandler.java
示例9: addAuthenticationMechanism
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public void addAuthenticationMechanism(final AuthenticationMechanism handler) {
// TODO - Do we want to change this so we can ensure the mechanisms are not modifiable mid request?
authMechanisms.add(handler);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:SecurityContextImpl.java
示例10: getAuthenticationMechanisms
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public List<AuthenticationMechanism> getAuthenticationMechanisms() {
return Collections.unmodifiableList(authMechanisms);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SecurityContextImpl.java
示例11: AuthAttempter
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
private AuthAttempter(final Iterator<AuthenticationMechanism> mechanismIterator, final HttpServerExchange exchange) {
this.mechanismIterator = mechanismIterator;
this.exchange = exchange;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SecurityContextImpl.java
示例12: ChallengeSender
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
private ChallengeSender(final Iterator<AuthenticationMechanism> mechanismIterator, final HttpServerExchange exchange) {
this.mechanismIterator = mechanismIterator;
this.exchange = exchange;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:SecurityContextImpl.java
示例13: create
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return new ExternalAuthenticationMechanism(mechanismName);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ExternalAuthenticationMechanism.java
示例14: create
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
String realm = properties.get(REALM);
String silent = properties.get(SILENT);
return new BasicAuthenticationMechanism(realm, mechanismName, silent != null && silent.equals("true"));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:BasicAuthenticationMechanism.java
示例15: create
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
String forceRenegotiation = properties.get(FORCE_RENEGOTIATION);
return new ClientCertAuthenticationMechanism(mechanismName, forceRenegotiation == null ? true : "true".equals(forceRenegotiation));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:ClientCertAuthenticationMechanism.java
示例16: create
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return new DigestAuthenticationMechanism(properties.get(REALM), properties.get(CONTEXT_PATH), mechanismName);
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:DigestAuthenticationMechanism.java
示例17: getJaspiAuthenticationMechanism
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
public AuthenticationMechanism getJaspiAuthenticationMechanism() {
return jaspiAuthenticationMechanism;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:DeploymentInfo.java
示例18: setJaspiAuthenticationMechanism
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
public void setJaspiAuthenticationMechanism(AuthenticationMechanism jaspiAuthenticationMechanism) {
this.jaspiAuthenticationMechanism = jaspiAuthenticationMechanism;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:DeploymentInfo.java
示例19: create
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
@Override
public AuthenticationMechanism create(String mechanismName, FormParserFactory formParserFactory, Map<String, String> properties) {
return new ServletFormAuthenticationMechanism(formParserFactory, mechanismName, properties.get(LOGIN_PAGE), properties.get(ERROR_PAGE));
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ServletFormAuthenticationMechanism.java
示例20: setAuthenticationMechanisms
import io.undertow.security.api.AuthenticationMechanism; //导入依赖的package包/类
public void setAuthenticationMechanisms(List<AuthenticationMechanism> authenticationMechanisms) {
this.authenticationMechanisms = authenticationMechanisms;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:DeploymentImpl.java
注:本文中的io.undertow.security.api.AuthenticationMechanism类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论