updated logs
This commit is contained in:
parent
7c1f0ad829
commit
13c271ca37
|
@ -40,7 +40,6 @@ public class IAMClientIdentity implements GcubeIdentity {
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.trace("Read credentials: " + credentials);
|
LOG.trace("Read credentials: " + credentials);
|
||||||
String umaAcessToken = null;
|
|
||||||
clientId = credentials.getClientId();
|
clientId = credentials.getClientId();
|
||||||
String clientSecret = credentials.getClientSecret();
|
String clientSecret = credentials.getClientSecret();
|
||||||
try {
|
try {
|
||||||
|
@ -49,10 +48,9 @@ public class IAMClientIdentity implements GcubeIdentity {
|
||||||
TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(currentScope, clientId, clientSecret, currentScope,
|
TokenResponse tr = KeycloakClientFactory.newInstance().queryUMAToken(currentScope, clientId, clientSecret, currentScope,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
umaAcessToken = tr.getAccessToken();
|
currentUMAToken = tr.getAccessToken();
|
||||||
if (umaAcessToken != null && !umaAcessToken.isEmpty()) {
|
if (currentUMAToken != null && !currentUMAToken.isEmpty()) {
|
||||||
LOG.info("UMA Access Token read correctly");
|
LOG.info("UMA Access Token read correctly");
|
||||||
currentUMAToken = umaAcessToken;
|
|
||||||
} else {
|
} else {
|
||||||
LOG.error("UMA Access Token NOT RETRIEVED!!!");
|
LOG.error("UMA Access Token NOT RETRIEVED!!!");
|
||||||
throw new Exception("UMA Access Token is null or empty");
|
throw new Exception("UMA Access Token is null or empty");
|
||||||
|
@ -63,6 +61,8 @@ public class IAMClientIdentity implements GcubeIdentity {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
LOG.debug("JWT token: " + currentUMAToken.substring(0, 20) + "_MASKED_TOKEN_");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Here the previousUMAToken should be null
|
// Here the previousUMAToken should be null
|
||||||
previousUMAToken = AccessTokenProvider.instance.get();
|
previousUMAToken = AccessTokenProvider.instance.get();
|
||||||
|
@ -71,10 +71,9 @@ public class IAMClientIdentity implements GcubeIdentity {
|
||||||
// silent
|
// silent
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.debug("JWT token: " + umaAcessToken.substring(0, 20) + "_MASKED_TOKEN_");
|
|
||||||
LOG.info("Setting clientId '" + clientId + "' identity by JWT token in the "
|
LOG.info("Setting clientId '" + clientId + "' identity by JWT token in the "
|
||||||
+ AccessTokenProvider.class.getSimpleName());
|
+ AccessTokenProvider.class.getSimpleName());
|
||||||
AccessTokenProvider.instance.set(umaAcessToken);
|
AccessTokenProvider.instance.set(currentUMAToken);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error(e.getMessage(), e);
|
LOG.error(e.getMessage(), e);
|
||||||
throw new Exception(e.getMessage());
|
throw new Exception(e.getMessage());
|
||||||
|
|
|
@ -22,8 +22,8 @@ public class UserIdentity implements GcubeIdentity {
|
||||||
public void setIdentity(HttpServletRequest httpRequest) throws Exception {
|
public void setIdentity(HttpServletRequest httpRequest) throws Exception {
|
||||||
LOG.info("setIdentity called");
|
LOG.info("setIdentity called");
|
||||||
this.httpRequest = httpRequest;
|
this.httpRequest = httpRequest;
|
||||||
SessionUtil.getCurrentToken(httpRequest, true);
|
SessionUtil.getCurrentToken(this.httpRequest, true);
|
||||||
user = SessionUtil.getCurrentUser(httpRequest);
|
user = SessionUtil.getCurrentUser(this.httpRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class UserIdentity implements GcubeIdentity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getToken() {
|
public String getToken() {
|
||||||
return SessionUtil.getCurrentToken(httpRequest, true);
|
return SessionUtil.getCurrentToken(this.httpRequest, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue