“HTTPS required” while logging in to Keycloak as admin

前端 未结 7 1197
逝去的感伤
逝去的感伤 2021-02-02 09:46

\"enter

I am using Keycloak (version 1.0.4.Final) in JBOSS AS 7.1.1

相关标签:
7条回答
  • 2021-02-02 10:18

    I testing in docker keycloak: probe that: Realm Settings -> Login -> Require SSL and put in off. or docker exec YOUR_DOCKER_NAME /opt/jboss/keycloak/bin/jboss-cli.sh --connect \ "/subsystem=undertow/server=default-server/http-listener=default:read-resource"

    0 讨论(0)
  • 2021-02-02 10:25

    If you are deploying keycloak on kubernetes you can try setting up following ENV VAR

    spec:
      containers:
      - name: keycloak
        env:
        - name:  PROXY_ADDRESS_FORWARDING
          value: "true"
    
    0 讨论(0)
  • 2021-02-02 10:33

    It's a bit late but I'm sure people will find this useful. If you are using docker to run keycloak, instead of forwarding port 8080, forward 8443 and it works like charm.

    docker run -p 8443:8443 -e KEYCLOAK_USER=username -e KEYCLOAK_PASSWORD=password jboss/keycloak
    
    0 讨论(0)
  • 2021-02-02 10:36

    If you want to disable it for your realm and have no possibility to use UI, do it directly on the database:

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

    Note - Restart keycloak for effect

    0 讨论(0)
  • 2021-02-02 10:38

    This is quite old and now on release versions (I am using Keycloak 1.9.3 demo / Developer bundle), however to save some poor soul some time....

    Keycloak now defaults to HTTPS for all external IP addresses. Unfortunately, from what I can tell the Wildfly instance that comes with the demo bundle does NOT support HTTPS. Makes for a pretty insane default if you're installing Keycloak on a remote machine as there is effectively no way to access the Keycloak admin console out of the box.

    At this point, you have two options; 1) Install HTTPS in Wildfly or 2) Tunnel via SSH into the remote machine and proxy your browser through it, go to the admin console and turn off the SSL requirement (Realm Settings -> Login -> Require SSL). This works because SSL is not required for local connections.

    Remember to first create the admin user by going to $KEYCLOAK_HOME/keycloak/bin and running ./add-user-keycloak -r master -u <> -p <>. This add user script is not interactive like the Wildfly add user script is, you need to put it all on the command line.

    Hope this helps!

    0 讨论(0)
  • 2021-02-02 10:39

    You can use the keycloak command line admin tool to change the setting as long as it can authenticate to a local IP address. You can temporarily launch Keycloak on localhost to make this change.

    kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin
    kcadm.sh update realms/realmname -s sslRequired=NONE
    

    Obviously, make sure to replace realm names, username, port, etc as required.

    For more information on getting started with the Admin CLI, see documentation: http://www.keycloak.org/docs/3.3/server_admin/topics/admin-cli.html

    0 讨论(0)
提交回复
热议问题