Package com.appslandia.plum.base
Class AuthContext
- java.lang.Object
-
- com.appslandia.plum.base.AuthContext
-
-
Field Summary
Fields Modifier and Type Field Description protected javax.enterprise.inject.Instance<HttpAuthenticationMechanismBase>authenticationMechanismprotected javax.security.enterprise.SecurityContextsecurityContextprotected VerifyServiceverifyService
-
Constructor Summary
Constructors Constructor Description AuthContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanauthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthParameters authParameters, com.appslandia.common.base.Out<String> failureCode)<T extends javax.security.enterprise.credential.UsernamePasswordCredential>
booleanauthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, T credential, boolean rememberMe, com.appslandia.common.base.Out<String> failureCode)UserPrincipalgetRequiredPrincipal()intgetUserId()UserPrincipalgetUserPrincipal()protected voidinitialize()booleanisCallerInRoles(String... roles)booleanreauthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ReauthByCodeCredential credential, com.appslandia.common.base.Out<String> failureCode)
-
-
-
Field Detail
-
securityContext
@Inject protected javax.security.enterprise.SecurityContext securityContext
-
verifyService
@Inject protected VerifyService verifyService
-
authenticationMechanism
@Inject protected javax.enterprise.inject.Instance<HttpAuthenticationMechanismBase> authenticationMechanism
-
-
Method Detail
-
initialize
@PostConstruct protected void initialize()
-
authenticate
public <T extends javax.security.enterprise.credential.UsernamePasswordCredential> boolean authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, T credential, boolean rememberMe, com.appslandia.common.base.Out<String> failureCode)
-
authenticate
public boolean authenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthParameters authParameters, com.appslandia.common.base.Out<String> failureCode)
-
reauthenticate
public boolean reauthenticate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, ReauthByCodeCredential credential, com.appslandia.common.base.Out<String> failureCode) throws javax.servlet.ServletException- Throws:
javax.servlet.ServletException
-
isCallerInRoles
public boolean isCallerInRoles(String... roles)
-
getUserPrincipal
public UserPrincipal getUserPrincipal()
-
getRequiredPrincipal
public UserPrincipal getRequiredPrincipal()
-
getUserId
public int getUserId()
-
-