Moved from UmaJWTProvider in `common-authorization` for intra-portal use only
This commit is contained in:
parent
51677353b0
commit
cc3f2ba652
|
@ -0,0 +1,30 @@
|
|||
package org.gcube.portal.oidc.lr62;
|
||||
|
||||
public class UMATokensProvider {
|
||||
|
||||
public static UMATokensProvider instance = new UMATokensProvider();
|
||||
|
||||
private static final InheritableThreadLocal<String> threadToken = new InheritableThreadLocal<String>() {
|
||||
|
||||
@Override
|
||||
protected String initialValue() {
|
||||
return null;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private UMATokensProvider() {
|
||||
}
|
||||
|
||||
public String get() {
|
||||
return threadToken.get();
|
||||
}
|
||||
|
||||
public void set(String jwt) {
|
||||
threadToken.set(jwt);
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
threadToken.remove();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue