Package org.gcube.portal.oidc.lr62
Class OIDCUmaUtil
- java.lang.Object
-
- org.gcube.portal.oidc.lr62.OIDCUmaUtil
-
public class OIDCUmaUtil extends Object
-
-
Constructor Summary
Constructors Constructor Description OIDCUmaUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckUMATicketAndProvideInThreadLocal(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, com.liferay.portal.model.User user, javax.servlet.http.HttpSession session, String scope)protected static voidforceLogout(javax.servlet.http.HttpServletResponse response)static org.gcube.oidc.rest.JWTTokengetUMAToken(javax.servlet.http.HttpServletRequest request, com.liferay.portal.model.User user, String scope)static org.gcube.oidc.rest.JWTTokengetUMAToken(javax.servlet.http.HttpServletRequest request, Long userId, String scope)Used to request a temporary UMA/RPT token to the OIDC server in a specific context for an user.static org.gcube.oidc.rest.JWTTokengetUMAToken(javax.servlet.http.HttpServletRequest request, String screenName, String scope)Used to request a temporary UMA/RPT token to the OIDC server in a specific context for an user.static voidprovideClientUMATokenInThreadLocal(String clientId, String clientSecret, URL tokenURL, String infraContext)static voidprovideClientUMATokenInThreadLocal(String clientAuthorizationBearer, URL tokenURL, String infraContext)static voidprovideConfiguredPortalClientUMATokenInThreadLocal(String infraContext)static voidprovideTokensInThreadlocal(org.gcube.oidc.rest.JWTToken umaTokens)
-
-
-
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, NotAuthorizedExceptionUsed to request a temporary UMA/RPT token to the OIDC server in a specific context for an user. The OIDC access token in theJWTCacheProxyfor the user in the currentsessionwill be used.- Parameters:
request- the current HTTP requestuserId- the user's user idscope- 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 occursInvalidTokenException- if the OIDC access token is become invalid for the userMissingTokenException- if the OIDC token is missing for the user in the cache proxyRefreshException- if an error occurs refreshing the OIDC token that is expiredNotAuthorizedException- 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, NotAuthorizedExceptionUsed to request a temporary UMA/RPT token to the OIDC server in a specific context for an user. The OIDC access token in theJWTCacheProxyfor the user in the currentsessionwill be used.- Parameters:
request- the current HTTP requestscreenName- the user's screen namescope- 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 occursInvalidTokenException- if the OIDC access token is become invalid for the userMissingTokenException- if the OIDC token is missing for the user in the cache proxyRefreshException- if an error occurs refreshing the OIDC token that is expiredNotAuthorizedException- 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, com.liferay.portal.model.User user, String scope) throws InvalidTokenException, MissingTokenException, RefreshException, NotAuthorizedException, UMAException
-
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)
-
-