Class OIDCUmaUtil


  • public class OIDCUmaUtil
    extends Object
    • Constructor Detail

      • OIDCUmaUtil

        public OIDCUmaUtil()
    • Method Detail

      • provideConfiguredPortalClientUMATokenInThreadLocal

        public static void provideConfiguredPortalClientUMATokenInThreadLocal​(String infraContext)
      • provideClientUMATokenInThreadLocal

        public static void provideClientUMATokenInThreadLocal​(String clientId,
                                                              String clientSecret,
                                                              URL tokenURL,
                                                              String infraContext)
      • provideClientUMATokenInThreadLocal

        public static void provideClientUMATokenInThreadLocal​(String clientAuthorizationBearer,
                                                              URL tokenURL,
                                                              String infraContext)
      • getUMAToken

        public static org.gcube.oidc.rest.JWTToken getUMAToken​(javax.servlet.http.HttpServletRequest request,
                                                               Long userId,
                                                               String scope)
                                                        throws UMAException,
                                                               InvalidTokenException,
                                                               MissingTokenException,
                                                               RefreshException,
                                                               NotAuthorizedException
        Used to request a temporary UMA/RPT token to the OIDC server in a specific context for an user. The OIDC access token in the JWTCacheProxy for the user in the current session will be used.
        Parameters:
        request - the current HTTP request
        userId - the user's user id
        scope - the scope to issue the token for (e.g. "/gcube")
        Returns:
        the temporary token in the requested context for the user
        Throws:
        UMAException - if a generic error related to the UMA/RPT token issue occurs
        InvalidTokenException - if the OIDC access token is become invalid for the user
        MissingTokenException - if the OIDC token is missing for the user in the cache proxy
        RefreshException - if an error occurs refreshing the OIDC token that is expired
        NotAuthorizedException - if the user is not authorized to access the requested context
      • getUMAToken

        public static org.gcube.oidc.rest.JWTToken getUMAToken​(javax.servlet.http.HttpServletRequest request,
                                                               String screenName,
                                                               String scope)
                                                        throws UMAException,
                                                               InvalidTokenException,
                                                               MissingTokenException,
                                                               RefreshException,
                                                               NotAuthorizedException
        Used to request a temporary UMA/RPT token to the OIDC server in a specific context for an user. The OIDC access token in the JWTCacheProxy for the user in the current session will be used.
        Parameters:
        request - the current HTTP request
        screenName - the user's screen name
        scope - the scope to issue the token for (e.g. "/gcube")
        Returns:
        the temporary token in the requested context for the user
        Throws:
        UMAException - if a generic error related to the UMA/RPT token issue occurs
        InvalidTokenException - if the OIDC access token is become invalid for the user
        MissingTokenException - if the OIDC token is missing for the user in the cache proxy
        RefreshException - if an error occurs refreshing the OIDC token that is expired
        NotAuthorizedException - if the user is not authorized to access the requested context
      • checkUMATicketAndProvideInThreadLocal

        public static void checkUMATicketAndProvideInThreadLocal​(javax.servlet.http.HttpServletRequest request,
                                                                 javax.servlet.http.HttpServletResponse response,
                                                                 com.liferay.portal.model.User user,
                                                                 javax.servlet.http.HttpSession session,
                                                                 String scope)
      • provideTokensInThreadlocal

        public static void provideTokensInThreadlocal​(org.gcube.oidc.rest.JWTToken umaTokens)
      • forceLogout

        protected static void forceLogout​(javax.servlet.http.HttpServletResponse response)