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, setAuthenticationRequired
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
authenticationComplete, authenticationFailed, getAuthenticatedAccount, getMechanismName, isAuthenticated, isAuthenticationRequired, registerNotificationReceiver, removeNotificationReceiver, setAuthenticationRequired
public SecurityContextImpl(HttpServerExchange exchange, IdentityManager identityManager)
public SecurityContextImpl(HttpServerExchange exchange, AuthenticationMode authenticationMode, IdentityManager identityManager)
public boolean authenticate()
SecurityContext
true
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 SecurityContext
true
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)
AuthenticationMechanismContext
SecurityContext.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 AuthenticationMechanismContext
addAuthenticationMechanism
in interface SecurityContext
handler
- The mechanism to add@Deprecated public List<AuthenticationMechanism> getAuthenticationMechanisms()
getAuthenticationMechanisms
in interface SecurityContext
@Deprecated public IdentityManager getIdentityManager()
SecurityContext
IdentityManager
to use to make account verification decisions.getIdentityManager
in interface SecurityContext
IdentityManager
public boolean login(String username, String password)
SecurityContext
AuthenticatedSessionManager
(if any), so subsequent requests will automatically be authenticated as this user. This operation may block
login
in interface SecurityContext
username
- The usernamepassword
- The passwordtrue
if the login succeeded, false otherwisepublic void logout()
SecurityContext
logout
in interface SecurityContext
logout
in class AbstractSecurityContext
Copyright © 2015 JBoss by Red Hat. All rights reserved.