|
|
|
@ -5,7 +5,7 @@ import org.gcube.common.authorization.library.AuthorizationEntry;
|
|
|
|
|
import org.gcube.common.authorization.library.provider.AuthorizationProvider;
|
|
|
|
|
import org.gcube.common.authorization.library.provider.ClientInfo;
|
|
|
|
|
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|
|
|
|
import org.gcube.common.authorization.library.provider.UmaJWTProvider;
|
|
|
|
|
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
|
|
|
|
import org.gcube.common.scope.api.ScopeProvider;
|
|
|
|
|
import org.gcube.usecases.ws.thredds.model.SynchFolderConfiguration;
|
|
|
|
|
import static org.gcube.common.authorization.client.Constants.authorizationService;
|
|
|
|
@ -29,7 +29,7 @@ public class Security {
|
|
|
|
|
}catch(Throwable e) {
|
|
|
|
|
log.warn("Unable to get client info ",e);
|
|
|
|
|
}
|
|
|
|
|
User toReturn = new User(client,UmaJWTProvider.instance.get(),SecurityTokenProvider.instance.get(),context);
|
|
|
|
|
User toReturn = new User(client,AccessTokenProvider.instance.get(),SecurityTokenProvider.instance.get(),context);
|
|
|
|
|
|
|
|
|
|
log.info("Current User is {} ",toReturn);
|
|
|
|
|
return toReturn;
|
|
|
|
@ -40,7 +40,7 @@ public class Security {
|
|
|
|
|
//cleanup everything
|
|
|
|
|
resetUser();
|
|
|
|
|
log.debug("Setting User {} ",toSet);
|
|
|
|
|
if(toSet.getUma_token()!=null)UmaJWTProvider.instance.set(toSet.getUma_token());
|
|
|
|
|
if(toSet.getUma_token()!=null)AccessTokenProvider.instance.set(toSet.getUma_token());
|
|
|
|
|
if(toSet.getGcube_token()!=null)SecurityTokenProvider.instance.set(toSet.getGcube_token());
|
|
|
|
|
if(toSet.getContext()!=null)ScopeProvider.instance.set(toSet.getContext());
|
|
|
|
|
}
|
|
|
|
@ -49,7 +49,7 @@ public class Security {
|
|
|
|
|
public static void resetUser(){
|
|
|
|
|
log.debug("Resetting user");
|
|
|
|
|
SecurityTokenProvider.instance.reset();
|
|
|
|
|
UmaJWTProvider.instance.reset();
|
|
|
|
|
AccessTokenProvider.instance.reset();
|
|
|
|
|
ScopeProvider.instance.reset();
|
|
|
|
|
}
|
|
|
|
|
public static void checkOperator(SynchFolderConfiguration config) throws SecurityException{
|
|
|
|
|