refactoring code

This commit is contained in:
Roberto Cirillo 2021-05-12 17:45:47 +02:00
parent bf2f5b55e1
commit 57826ed6ff
1 changed files with 3 additions and 1 deletions

View File

@ -23,9 +23,10 @@ public class Utils {
public static JWTToken setToken(URL oidcAddress, String clientId, String secret) throws OpenIdConnectRESTHelperException {
JWTToken token=null;
String context=ScopeProvider.instance.get();
try {
logger.trace("setToken method");
String context=ScopeProvider.instance.get();
logger.trace("we are in "+context);
if((!Objects.isNull(context)) && (!Objects.isNull(clientId))&& (!Objects.isNull(secret))) {
logger.info(clientId+" getting the UMAtoken for context "+context);
@ -40,6 +41,7 @@ public class Utils {
}
}catch(Throwable t) {
logger.error("Exception: ", t);
throw new RuntimeException("Problem with tokens in context"+context+" ", t);
}
return token;
}