credentials for exchange client from specific parameters in config
This commit is contained in:
parent
f08edf6985
commit
c70331e6a6
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
## [v1.3.0-SNAPSHOT] - 20240-03-22
|
## [v1.3.0-SNAPSHOT] - 20240-03-22
|
||||||
Token exchange (#27099)
|
Token exchange (#27099)
|
||||||
|
Client-exchange configuration for a dedicated client (#27204)
|
||||||
|
|
||||||
## [v1..0] - 2023-03-20
|
## [v1.2.0] - 2023-03-20
|
||||||
|
|
||||||
- Decode Button
|
- Decode Button
|
||||||
- Updatet layout
|
- Updatet layout
|
||||||
|
|
|
@ -31,6 +31,7 @@ import com.liferay.portal.kernel.json.JSONFactoryUtil;
|
||||||
import com.liferay.portal.kernel.json.JSONObject;
|
import com.liferay.portal.kernel.json.JSONObject;
|
||||||
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
import com.liferay.portal.kernel.log.LogFactoryUtil;
|
||||||
import com.liferay.portal.kernel.util.ParamUtil;
|
import com.liferay.portal.kernel.util.ParamUtil;
|
||||||
|
import com.liferay.portal.kernel.util.PrefsPropsUtil;
|
||||||
import com.liferay.portal.model.User;
|
import com.liferay.portal.model.User;
|
||||||
import com.liferay.portal.util.PortalUtil;
|
import com.liferay.portal.util.PortalUtil;
|
||||||
import com.liferay.util.bridges.mvc.MVCPortlet;
|
import com.liferay.util.bridges.mvc.MVCPortlet;
|
||||||
|
@ -122,19 +123,24 @@ public class RPTTokenReader extends MVCPortlet {
|
||||||
|
|
||||||
// URL auth_url = configuration.getTokenURL();
|
// URL auth_url = configuration.getTokenURL();
|
||||||
// log.info("auth_url " + auth_url);
|
// log.info("auth_url " + auth_url);
|
||||||
log.info("authToken '" + authToken.getAccessTokenString() + "'");
|
// log.info("authToken '" + authToken.getAccessTokenString() + "'");
|
||||||
// log.info("umaToken " + umaToken.getAccessTokenString());
|
// log.info("umaToken " + umaToken.getAccessTokenString());
|
||||||
// log.info("context " + context);
|
// log.info("context " + context);
|
||||||
// log.info("encoded_context " + urlEncodedContext);
|
// log.info("encoded_context " + urlEncodedContext);
|
||||||
// log.info("client_id " + configuration.getPortalClientId());
|
// log.info("client_id " + configuration.getPortalClientId());
|
||||||
// log.info("client_secret " + configuration.getPortalClientSecret());
|
// log.info("client_secret " + configuration.getPortalClientSecret());
|
||||||
|
|
||||||
|
Long companyId = PortalUtil.getCompanyId(httpReq);
|
||||||
|
|
||||||
|
String exchangeClientId = PrefsPropsUtil.getString(companyId, "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,
|
||||||
configuration.getPortalClientId(),
|
exchangeClientId,
|
||||||
configuration.getPortalClientSecret(),
|
exchangeClientSecret,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue