KEYCLOAK-504

Using https results in RuntimeException if sslRequired is set to false
This commit is contained in:
Stian Thorgersen 2014-06-06 14:54:11 +01:00
parent 80f4b668b2
commit f3211bf34d

View file

@ -280,13 +280,13 @@ public class AdapterDeploymentContext {
protected KeycloakUriBuilder getBaseBuilder(HttpFacade facade, String base) {
KeycloakUriBuilder builder = KeycloakUriBuilder.fromUri(base);
URI request = URI.create(facade.getRequest().getURI());
String scheme = "http";
String scheme = request.getScheme();
if (deployment.isSslRequired()) {
scheme = "https";
}
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
throw new RuntimeException("Can't resolve relative url from adapter config.");
if (!request.getScheme().equals(scheme) && request.getPort() != -1) {
log.error("request scheme: " + request.getScheme() + " ssl required: " + deployment.isSslRequired());
throw new RuntimeException("Can't resolve relative url from adapter config.");
}
}
builder.scheme(scheme);
builder.host(request.getHost());