Package org.mycore.frontend.jersey
Class MCRJWTUtil
java.lang.Object
org.mycore.frontend.jersey.MCRJWTUtil
- All Implemented Interfaces:
MCRStartupHandler.AutoExecutable
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.auth0.jwt.algorithms.Algorithm
static com.auth0.jwt.JWTCreator.Builder
getJWTBuilder
(MCRSession mcrSession) static com.auth0.jwt.JWTCreator.Builder
getJWTBuilder
(MCRSession mcrSession, String[] userAttributes, String[] sessionAttributes) static jakarta.ws.rs.core.Response
getJWTLoginErrorResponse
(String errorDescription) static jakarta.ws.rs.core.Response
static jakarta.ws.rs.core.Response
getName()
returns a name to display on start-up.int
If order is important returns as 'heigher' priority.void
startUp
(jakarta.servlet.ServletContext servletContext) This method get executed byMCRStartupHandler.startUp(ServletContext)
-
Field Details
-
JWT_CLAIM_ROLES
- See Also:
-
JWT_CLAIM_IP
- See Also:
-
JWT_USER_ATTRIBUTE_PREFIX
- See Also:
-
JWT_SESSION_ATTRIBUTE_PREFIX
- See Also:
-
-
Constructor Details
-
MCRJWTUtil
public MCRJWTUtil()
-
-
Method Details
-
getJWTBuilder
-
getJWTBuilder
public static com.auth0.jwt.JWTCreator.Builder getJWTBuilder(MCRSession mcrSession, String[] userAttributes, String[] sessionAttributes) -
getJWTAlgorithm
public static com.auth0.jwt.algorithms.Algorithm getJWTAlgorithm() -
getJWTLoginSuccessResponse
- Throws:
IOException
-
getJWTRenewSuccessResponse
- Throws:
IOException
-
getJWTLoginErrorResponse
public static jakarta.ws.rs.core.Response getJWTLoginErrorResponse(String errorDescription) throws IOException - Throws:
IOException
-
getName
Description copied from interface:MCRStartupHandler.AutoExecutable
returns a name to display on start-up.- Specified by:
getName
in interfaceMCRStartupHandler.AutoExecutable
-
getPriority
public int getPriority()Description copied from interface:MCRStartupHandler.AutoExecutable
If order is important returns as 'heigher' priority.- Specified by:
getPriority
in interfaceMCRStartupHandler.AutoExecutable
-
startUp
public void startUp(jakarta.servlet.ServletContext servletContext) Description copied from interface:MCRStartupHandler.AutoExecutable
This method get executed byMCRStartupHandler.startUp(ServletContext)
- Specified by:
startUp
in interfaceMCRStartupHandler.AutoExecutable
-