Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Globally disable https keycloak

The deployment is on AWS and I do not want to tunnel to the box and open a browser to disable it.

There seems to exist a configuration: "ssl-required":"none" that can be placed in the keycloak-server.json file, but I'm not sure under which object. I've tried under "realm" and by itself with no luck.

I do not want to disable it at the adapter level, it needs to be globally, so where does the "ssl-required":"none" go, or how can ssh/https be disabled globally?

(Also, I understand this is not recommended in production.)

like image 549
BatteryAcid Avatar asked Jul 12 '16 20:07

BatteryAcid


People also ask

How do I disable https in Keycloak?

Setting —proxy=edge opens the HTTP port on Keycloak and there is no encryption needed between your reverse proxy and the Keycloak instances. But your reverse proxy needs to handle all the https/tls termination from the users browser requests, then, no https redirect is being sent.

What is Keycloak SSL required?

Keycloak does not require SSL. This should really only be used in development when you are playing around with things and don't want to bother configuring SSL on your server. all requests.


3 Answers

In the "master" realm, over login tab. Change 'Require SSL' property to none.

If you can not access locally to keycloak and it is configured with a database for instance Postgres, then execute the following SQL sentence.

update REALM set ssl_required = 'NONE' where id = 'master';

It is necessary to restart keycloak

like image 58
anromer Avatar answered Nov 13 '22 07:11

anromer


I was run de Keycloak admin command to apply sslRequired=NONE.

$ docker exec -it CONTAINER-ID bash
$ cd /opt/jboss/keycloak/bin/
-- Run authenticate
$ ./kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin
-- Apply sslRequired to none
$ ./kcadm.sh update realms/master -s sslRequired=NONE

If you don't know user and/ou password I recomend run:

$ ./add-user-keycloak.sh --server http://localhost:8080/admin --realm master --user admin --password YOUR-PASSWORD
like image 39
Deusimar Ferreira Avatar answered Nov 13 '22 09:11

Deusimar Ferreira


Im my case, I'm using Keycloak Server with Spring Boot. I can change sslRequired from Master Realm by code, extending the KeycloakApplication:

public class EmbeddedKeycloakApplication extends KeycloakApplication {
...

public EmbeddedKeycloakApplication() {
        super();        
        changeMasterRealm();
        ...
    }

private void changeMasterRealm() {
        KeycloakSession session = getSessionFactory().create();
        try {
            session.getTransactionManager().begin();
            RealmManager manager = new RealmManager(session);
            manager.getRealm("master").setSslRequired(SslRequired.NONE);
            session.getTransactionManager().commit();
        } catch (Exception ex) {            
            session.getTransactionManager().rollback();
        }
       
...
like image 1
Murilo Rodrigues Avatar answered Nov 13 '22 07:11

Murilo Rodrigues