public class SecurityContextImpl extends AbstractSecurityContext implements AuthenticationMechanismContext
exchange| Constructor and Description |
|---|
SecurityContextImpl(HttpServerExchange exchange,
AuthenticationMode authenticationMode,
IdentityManager identityManager) |
SecurityContextImpl(HttpServerExchange exchange,
IdentityManager identityManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAuthenticationMechanism(AuthenticationMechanism handler)
Adds an authentication mechanism to this context.
|
boolean |
authenticate()
Performs authentication on the request.
|
List<AuthenticationMechanism> |
getAuthenticationMechanisms()
Deprecated.
|
IdentityManager |
getIdentityManager()
Deprecated.
|
boolean |
login(String username,
String password)
Attempts to log the user in using the provided credentials.
|
void |
logout()
de-authenticates the current exchange.
|
void |
setProgramaticMechName(String programaticMechName)
Set the name of the mechanism used for authentication to be reported if authentication was handled programatically.
|
authenticationComplete, authenticationComplete, authenticationFailed, getAuthenticatedAccount, getMechanismName, isAuthenticated, isAuthenticationRequired, registerNotificationReceiver, removeNotificationReceiver, setAuthenticationRequiredclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitauthenticationComplete, authenticationFailed, getAuthenticatedAccount, getMechanismName, isAuthenticated, isAuthenticationRequired, registerNotificationReceiver, removeNotificationReceiver, setAuthenticationRequiredpublic SecurityContextImpl(HttpServerExchange exchange, IdentityManager identityManager)
public SecurityContextImpl(HttpServerExchange exchange, AuthenticationMode authenticationMode, IdentityManager identityManager)
public boolean authenticate()
SecurityContexttrue it can still have committed the response (e.g. form auth redirects back to the original
page). Callers should check that the exchange has not been ended before proceeding.authenticate in interface SecurityContexttrue if either the request is successfully authenticated or if there is no failure validating the
current request so that the request should continue to be processed, false if authentication was not
completed and challenge has been prepared for the client.public void setProgramaticMechName(String programaticMechName)
programaticMechName - public void addAuthenticationMechanism(AuthenticationMechanism handler)
AuthenticationMechanismContextSecurityContext.authenticate() is
called mechanisms will be iterated over in the order they are added, and given a chance to authenticate the user.addAuthenticationMechanism in interface AuthenticationMechanismContextaddAuthenticationMechanism in interface SecurityContexthandler - The mechanism to add@Deprecated public List<AuthenticationMechanism> getAuthenticationMechanisms()
getAuthenticationMechanisms in interface SecurityContext@Deprecated public IdentityManager getIdentityManager()
SecurityContextIdentityManager to use to make account verification decisions.getIdentityManager in interface SecurityContextIdentityManagerpublic boolean login(String username, String password)
SecurityContextAuthenticatedSessionManager (if any), so subsequent requests will automatically be authenticated
as this user.
This operation may block
login in interface SecurityContextusername - The usernamepassword - The passwordtrue if the login succeeded, false otherwisepublic void logout()
SecurityContextlogout in interface SecurityContextlogout in class AbstractSecurityContextCopyright © 2017 JBoss by Red Hat. All rights reserved.