Package no.polaric.core.auth
Class AuthService
java.lang.Object
no.polaric.core.auth.AuthService
Web services for login, autentication and authorization.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidauthStatus(io.javalin.http.Context ctx) Return authorization status (as JSON)org.pac4j.core.config.Configconf()Return the configurationvoidcorsHeaders(io.javalin.http.Context ctx) Produce CORS headers.voiddirectLogin(io.javalin.http.Context ctx) static voidgenBodyDigest(io.javalin.http.Context ctx) Generate a SHA256 digest of the request body.getAllowOrigin(io.javalin.http.Context ctx) Allowed origin (for CORS).static AuthInfogetAuthInfo(io.javalin.http.Context ctx) static AuthInfogetAuthInfo(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).groupDb()hmacAuth()voidvoidstart(io.javalin.Javalin a) Set up the services.static StringuserDb()
-
Field Details
-
mapper
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Constructor Details
-
AuthService
-
-
Method Details
-
toJson
-
conf
public org.pac4j.core.config.Config conf()Return the configuration -
hmacAuth
-
reloadPasswds
public void reloadPasswds() -
start
public void start(io.javalin.Javalin a) Set up the services. -
getAllowOrigin
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
-
groupDb
-
getUserLogins
-
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
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
-