Merge remote-tracking branch 'origin/smartgears_4'
Conflicts: pom.xml
This commit is contained in:
commit
1dba845d31
2
pom.xml
2
pom.xml
|
@ -20,7 +20,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>gcube-bom</artifactId>
|
||||||
<version>2.0.2</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
|
@ -145,6 +145,7 @@ public class DefaultKeycloakClient implements KeycloakClient {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
params.put(AUDIENCE_PARAMETER, Arrays.asList(URLEncoder.encode(checkAudience(audience), "UTF-8")));
|
params.put(AUDIENCE_PARAMETER, Arrays.asList(URLEncoder.encode(checkAudience(audience), "UTF-8")));
|
||||||
|
logger.trace("audience is {}", checkAudience(audience));
|
||||||
} catch (UnsupportedEncodingException e) {
|
} catch (UnsupportedEncodingException e) {
|
||||||
logger.error("Can't URL encode audience: {}", audience, e);
|
logger.error("Can't URL encode audience: {}", audience, e);
|
||||||
}
|
}
|
||||||
|
@ -180,10 +181,11 @@ public class DefaultKeycloakClient implements KeycloakClient {
|
||||||
.flatMap(p -> p.getValue().stream().map(v -> p.getKey() + "=" + v))
|
.flatMap(p -> p.getValue().stream().map(v -> p.getKey() + "=" + v))
|
||||||
.reduce((p1, p2) -> p1 + "&" + p2).orElse("");
|
.reduce((p1, p2) -> p1 + "&" + p2).orElse("");
|
||||||
|
|
||||||
|
logger.trace("query string is {}", queryString);
|
||||||
|
|
||||||
request = GXHTTPStringRequest.newRequest(tokenURL.toString())
|
request = GXHTTPStringRequest.newRequest(tokenURL.toString())
|
||||||
.header("Content-Type", "application/x-www-form-urlencoded").withBody(queryString);
|
.header("Content-Type", "application/x-www-form-urlencoded").withBody(queryString);
|
||||||
|
|
||||||
request.isExternalCall(true);
|
|
||||||
if (authorization != null) {
|
if (authorization != null) {
|
||||||
logger.debug("Adding authorization header as: {}", authorization);
|
logger.debug("Adding authorization header as: {}", authorization);
|
||||||
request = request.header("Authorization", authorization);
|
request = request.header("Authorization", authorization);
|
||||||
|
@ -280,7 +282,6 @@ public class DefaultKeycloakClient implements KeycloakClient {
|
||||||
request = GXHTTPStringRequest.newRequest(tokenURL.toString()).header("Content-Type",
|
request = GXHTTPStringRequest.newRequest(tokenURL.toString()).header("Content-Type",
|
||||||
"application/x-www-form-urlencoded").withBody(queryString);
|
"application/x-www-form-urlencoded").withBody(queryString);
|
||||||
|
|
||||||
request.isExternalCall(true);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new KeycloakClientException("Cannot construct the request object correctly", e);
|
throw new KeycloakClientException("Cannot construct the request object correctly", e);
|
||||||
}
|
}
|
||||||
|
@ -336,7 +337,6 @@ public class DefaultKeycloakClient implements KeycloakClient {
|
||||||
request = GXHTTPStringRequest.newRequest(introspectionURL.toString()).header("Content-Type",
|
request = GXHTTPStringRequest.newRequest(introspectionURL.toString()).header("Content-Type",
|
||||||
"application/x-www-form-urlencoded").withBody(queryString);
|
"application/x-www-form-urlencoded").withBody(queryString);
|
||||||
|
|
||||||
request.isExternalCall(true);
|
|
||||||
request = request.header("Authorization", constructBasicAuthenticationHeader(clientId, clientSecret));
|
request = request.header("Authorization", constructBasicAuthenticationHeader(clientId, clientSecret));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new KeycloakClientException("Cannot construct the request object correctly", e);
|
throw new KeycloakClientException("Cannot construct the request object correctly", e);
|
||||||
|
|
Loading…
Reference in New Issue