Class AuthService

java.lang.Object
no.polaric.core.auth.AuthService

public class AuthService extends Object
Web services for login, autentication and authorization.
  • Field Details

    • mapper

      protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
  • Constructor Details

  • Method Details

    • toJson

      public static String toJson(Object obj)
    • conf

      public org.pac4j.core.config.Config conf()
      Return the configuration
    • hmacAuth

      public HmacAuthenticator hmacAuth()
    • reloadPasswds

      public void reloadPasswds()
    • start

      public void start(io.javalin.Javalin a)
      Set up the services.
    • getAllowOrigin

      public String getAllowOrigin(io.javalin.http.Context ctx)
      Allowed origin (for CORS). If Origin header from request matches allowed origins regex. return it. Otherwise, null.
    • corsHeaders

      public void corsHeaders(io.javalin.http.Context ctx)
      Produce CORS headers. If Origin header from request matches allowed origins regex. add it to the Allow-Origin response header. FIXME: How is CORS done in Javalin???
    • userDb

      public UserDb userDb()
    • groupDb

      public GroupDb groupDb()
    • authStatus

      public static void authStatus(io.javalin.http.Context ctx)
      Return authorization status (as JSON)
    • directLogin

      public void directLogin(io.javalin.http.Context ctx)
    • genBodyDigest

      public static void genBodyDigest(io.javalin.http.Context ctx)
      Generate a SHA256 digest of the request body. The resulting digiest is added as an attribute "bodyHash" on the request
    • getAuthInfo

      public static AuthInfo getAuthInfo(org.pac4j.core.context.WebContext context)
      Create an AuthInfo object from the user profile and add it as an attribute on the request (if not there already). This is not the same as the user profile generated by Pac4J. The AuthInfo will be available for application and contains more information about authorizations etc
    • getAuthInfo

      public static AuthInfo getAuthInfo(io.javalin.http.Context ctx)