KEYCLOAK-504
Using https results in RuntimeException if sslRequired is set to false
This commit is contained in:
parent
80f4b668b2
commit
f3211bf34d
1 changed files with 5 additions and 5 deletions
|
@ -280,14 +280,14 @@ public class AdapterDeploymentContext {
|
||||||
protected KeycloakUriBuilder getBaseBuilder(HttpFacade facade, String base) {
|
protected KeycloakUriBuilder getBaseBuilder(HttpFacade facade, String base) {
|
||||||
KeycloakUriBuilder builder = KeycloakUriBuilder.fromUri(base);
|
KeycloakUriBuilder builder = KeycloakUriBuilder.fromUri(base);
|
||||||
URI request = URI.create(facade.getRequest().getURI());
|
URI request = URI.create(facade.getRequest().getURI());
|
||||||
String scheme = "http";
|
String scheme = request.getScheme();
|
||||||
if (deployment.isSslRequired()) {
|
if (deployment.isSslRequired()) {
|
||||||
scheme = "https";
|
scheme = "https";
|
||||||
}
|
|
||||||
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
|
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
|
||||||
log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
|
log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
|
||||||
throw new RuntimeException("Can't resolve relative url from adapter config.");
|
throw new RuntimeException("Can't resolve relative url from adapter config.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
builder.scheme(scheme);
|
builder.scheme(scheme);
|
||||||
builder.host(request.getHost());
|
builder.host(request.getHost());
|
||||||
if (request.getPort() != -1) {
|
if (request.getPort() != -1) {
|
||||||
|
|
Loading…
Reference in a new issue