removed logs

This commit is contained in:
Alfredo Oliviero 2024-04-17 11:08:18 +02:00
parent c70331e6a6
commit 910397f3d1
2 changed files with 15 additions and 21 deletions

View File

@ -44,7 +44,12 @@ public class OpenIdConnectRESTHelperExtended extends OpenIdConnectRESTHelper {
String client_secret, String client_secret,
List<String> permissions) throws OpenIdConnectRESTHelperException { List<String> permissions) throws OpenIdConnectRESTHelperException {
logger.info("Queried exchangeToken for context " + audience); // logger.info("Queried exchangeToken for context " + audience);
// logger.info("token url " + tokenUrl);
// logger.info("exchangedToken credentials " + client_id + " " + client_secret) ;
Map<String, List<String>> params = new HashMap<>(); Map<String, List<String>> params = new HashMap<>();
Map<String, String> extraHeaders = new HashMap<>(); Map<String, String> extraHeaders = new HashMap<>();

View File

@ -63,14 +63,14 @@ public class RPTTokenReader extends MVCPortlet {
if (g.getGroupName().equals(PortalContext.getConfiguration().getInfrastructureName())) { if (g.getGroupName().equals(PortalContext.getConfiguration().getInfrastructureName())) {
String context = gm.getInfrastructureScope(g.getGroupId()); String context = gm.getInfrastructureScope(g.getGroupId());
userContexts.add(context); userContexts.add(context);
if (context.split("/").length == 4){ if (context.split("/").length == 4) {
vreContexts.add(context); vreContexts.add(context);
} }
} }
if (g.getParentGroupId() > 0) { if (g.getParentGroupId() > 0) {
String context = gm.getInfrastructureScope(g.getGroupId()); String context = gm.getInfrastructureScope(g.getGroupId());
userContexts.add(context); userContexts.add(context);
if (context.split("/").length == 4){ if (context.split("/").length == 4) {
vreContexts.add(context); vreContexts.add(context);
} }
} }
@ -97,7 +97,6 @@ public class RPTTokenReader extends MVCPortlet {
GroupManager gm = new LiferayGroupManager(); GroupManager gm = new LiferayGroupManager();
resourceResponse.setContentType("application/json"); resourceResponse.setContentType("application/json");
JSONObject jsonObject = JSONFactoryUtil.createJSONObject(); JSONObject jsonObject = JSONFactoryUtil.createJSONObject();
@ -119,32 +118,22 @@ public class RPTTokenReader extends MVCPortlet {
JWTToken authToken = jwtCacheProxy.getOIDCToken(theUser, sessionId); JWTToken authToken = jwtCacheProxy.getOIDCToken(theUser, sessionId);
// umaToken = OpenIdConnectRESTHelper.queryUMAToken(configuration.getTokenURL(), // umaToken = OpenIdConnectRESTHelper.queryUMAToken(configuration.getTokenURL(),
// authToken.getAccessTokenAsBearer(), urlEncodedContext, null); // authToken.getAccessTokenAsBearer(), urlEncodedContext, null);
// URL auth_url = configuration.getTokenURL();
// log.info("auth_url " + auth_url);
// log.info("authToken '" + authToken.getAccessTokenString() + "'");
// log.info("umaToken " + umaToken.getAccessTokenString());
// log.info("context " + context);
// log.info("encoded_context " + urlEncodedContext);
// log.info("client_id " + configuration.getPortalClientId());
// log.info("client_secret " + configuration.getPortalClientSecret());
Long companyId = PortalUtil.getCompanyId(httpReq); Long companyId = PortalUtil.getCompanyId(httpReq);
String exchangeClientId = PrefsPropsUtil.getString(companyId, "d4science.oidc-token-exchange-dedicated-client-id"); String exchangeClientId = PrefsPropsUtil.getString(companyId,
String exchangeClientSecret = PrefsPropsUtil.getString(companyId, "d4science.oidc-token-exchange-dedicated-client-secret"); "d4science.oidc-token-exchange-dedicated-client-id");
String exchangeClientSecret = PrefsPropsUtil.getString(companyId,
"d4science.oidc-token-exchange-dedicated-client-secret");
exchangedToken = OpenIdConnectRESTHelperExtended.ExtendedQueryExchangeToken( exchangedToken = OpenIdConnectRESTHelperExtended.ExtendedQueryExchangeToken(
configuration.getTokenURL(), configuration.getTokenURL(),
authToken.getAccessTokenString(), authToken.getAccessTokenString(),
urlEncodedContext, urlEncodedContext,
exchangeClientId, exchangeClientId,
exchangeClientSecret, exchangeClientSecret,
null null);
);
// log.info("exchangedToken " + exchangedToken.getAccessTokenString());
// log.debug("Got a new UMA token " + exchangedToken.getTokenEssentials()); // log.debug("Got a new UMA token " + exchangedToken.getTokenEssentials());
} catch (OpenIdConnectRESTHelperException e) { } catch (OpenIdConnectRESTHelperException e) {