Moved from UmaJWTProvider in `common-authorization` for intra-portal use only

This commit is contained in:
Mauro Mugnaini 2021-05-24 17:43:38 +02:00
parent 51677353b0
commit cc3f2ba652
1 changed files with 30 additions and 0 deletions

View File

@ -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();
}
}