Class AuthContext


  • @ApplicationScoped
    public class AuthContext
    extends Object
    Author:
    Loc Ha
    • Field Detail

      • securityContext

        @Inject
        protected javax.security.enterprise.SecurityContext securityContext
    • Constructor Detail

      • AuthContext

        public AuthContext()
    • Method Detail

      • 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)
      • getRequiredPrincipal

        public UserPrincipal getRequiredPrincipal()
      • getUserId

        public int getUserId()