Use jwt token
This commit is contained in:
parent
118a3474fa
commit
49120cf400
|
@ -7,6 +7,7 @@ import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
|||
import org.gcube.common.authorization.utils.manager.SecretManager;
|
||||
import org.gcube.common.authorization.utils.manager.SecretManagerProvider;
|
||||
import org.gcube.common.authorization.utils.secret.GCubeSecret;
|
||||
import org.gcube.common.authorization.utils.secret.JWTSecret;
|
||||
import org.gcube.common.authorization.utils.secret.Secret;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
|
||||
|
@ -37,9 +38,13 @@ public class TokenSetter {
|
|||
// oppure
|
||||
String toSet= props.getProperty(scope);
|
||||
log.debug("Setting secret "+toSet);
|
||||
Secret secret = new GCubeSecret(toSet); // se vecchio token
|
||||
// oppure
|
||||
// Secret secret = new JWTSecret(token); // se nuovo token
|
||||
|
||||
Secret secret = null;
|
||||
if(toSet.length()>50)
|
||||
secret = new JWTSecret(toSet); // se nuovo token
|
||||
else
|
||||
secret = new GCubeSecret(toSet); // se vecchio token
|
||||
|
||||
|
||||
SecretManagerProvider.instance.get().addSecret(secret);
|
||||
try{
|
||||
|
|
Loading…
Reference in New Issue