Skip to content

Commit 34b23f6

Browse files
authored
Merge pull request quarkusio#53224 from sberyozkin/keycloak_dev_service_disable_htts_docs
Add a Disable HTTPS note to Keyclok Dev Services doc
2 parents 0aacec4 + a9698db commit 34b23f6

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

docs/src/main/asciidoc/security-openid-connect-dev-services.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,36 @@ quarkus.keycloak.devservices.resource-mappings.policies=/opt/keycloak/providers/
309309
Policy jars can also be located in the file system.
310310
<2> The policies jar is mapped to the `/opt/keycloak/providers/policies.jar` container location.
311311

312+
== Disable HTTPS
313+
314+
In some cases, you might see Keycloak `HTTPS required` errors that cause either Keycloak startup or communication failures.
315+
316+
You might be facing a Docker issue that mainly affects MacOS users attempting to use Keycloak locally where the ports do not automatically bind to `localhost`.
317+
318+
The easiest option to resolve it is to disable HTTPS with a `quarkus.keycloak.devservices.disable-https=true` property.
319+
It runs the following Keycloak admin command inside your Keycloak container everytime it restarts:
320+
321+
[source,bash]
322+
----
323+
kcadm.sh update realms/master -s sslRequired=NONE
324+
----
325+
326+
Another approach is to provide a localhost with port bindings configuration.
327+
328+
A common solution is to update your `docker-compose` file to use a private IPv4 address, such as `localhost`.
329+
For example:
330+
331+
[source,yaml]
332+
----
333+
ports:
334+
- "127.0.0.1:8081:8080"
335+
----
336+
337+
Alternatively, you can change the default behaviour within MacOS Docker Desktop to use `localhost` when binding ports.
338+
Inside the Docker Desktop, go to `Settings > Resources > Network > Port Binding Behaviour` and change it to `localhost by default`.
339+
Be aware that this change is applied to all docker containers, and may have unforeseen side affects.
340+
Update to the latest version of Docker if you do not see this Docker Desktop option.
341+
312342
== Disable Dev Services for Keycloak
313343

314344
Dev Services for Keycloak is not activated if either `quarkus.oidc.auth-server-url` is already initialized or the default OIDC tenant is disabled with `quarkus.oidc.tenant.enabled=false`, regardless of whether you work with Keycloak or not.

0 commit comments

Comments
 (0)