Class JWTSecret
- java.lang.Object
-
- org.gcube.common.authorization.utils.secret.Secret
-
- org.gcube.common.authorization.utils.secret.JWTSecret
-
- All Implemented Interfaces:
Comparable<Secret>
public class JWTSecret extends Secret
- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected org.gcube.common.authorization.library.utils.Callercallerprotected org.gcube.common.authorization.library.provider.ClientInfoclientInfoprotected Stringcontextprotected org.gcube.common.iam.OIDCBearerAuthoidcBearerAuthprotected RenewalProviderrenewalProviderprotected Set<String>rolesstatic longTOLERANCEThe interval of time expressed in milliseconds used as guard to refresh the token before that it expires .
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gcube.common.authorization.library.utils.CallergetCaller()org.gcube.common.authorization.library.provider.ClientInfogetClientInfo()StringgetContext()Map<String,String>getHTTPAuthorizationHeaders()protected Set<String>getRoles()UsergetUser()StringgetUsername()booleanisExpired()booleanisRefreshable()voidresetToken()voidsetRenewalProvider(RenewalProvider renewalProvider)voidsetToken()-
Methods inherited from class org.gcube.common.authorization.utils.secret.Secret
check, compareTo, equals, getToken, hashCode, isApplication, reset, set, setAuthorizationProvider
-
-
-
-
Field Detail
-
TOLERANCE
public static final long TOLERANCE
The interval of time expressed in milliseconds used as guard to refresh the token before that it expires . TimeUnit has been used to in place of just using the number to have a clearer code
-
renewalProvider
protected RenewalProvider renewalProvider
-
clientInfo
protected org.gcube.common.authorization.library.provider.ClientInfo clientInfo
-
caller
protected org.gcube.common.authorization.library.utils.Caller caller
-
context
protected String context
-
oidcBearerAuth
protected org.gcube.common.iam.OIDCBearerAuth oidcBearerAuth
-
-
Constructor Detail
-
JWTSecret
public JWTSecret(String token)
-
-
Method Detail
-
setToken
public void setToken() throws Exception
-
resetToken
public void resetToken() throws Exception- Specified by:
resetTokenin classSecret- Throws:
Exception
-
getClientInfo
public org.gcube.common.authorization.library.provider.ClientInfo getClientInfo() throws Exception- Specified by:
getClientInfoin classSecret- Throws:
Exception
-
getCaller
public org.gcube.common.authorization.library.utils.Caller getCaller() throws Exception
-
getContext
public String getContext() throws Exception
- Specified by:
getContextin classSecret- Throws:
Exception
-
getUsername
public String getUsername() throws Exception
- Overrides:
getUsernamein classSecret- Throws:
Exception
-
getHTTPAuthorizationHeaders
public Map<String,String> getHTTPAuthorizationHeaders()
- Specified by:
getHTTPAuthorizationHeadersin classSecret
-
setRenewalProvider
public void setRenewalProvider(RenewalProvider renewalProvider)
-
isExpired
public boolean isExpired() throws Exception
-
isRefreshable
public boolean isRefreshable() throws Exception- Specified by:
isRefreshablein classSecret- Throws:
Exception
-
-