Note, this is different from app-authz-uma-photoz
vagrant up
And your vm should start. After it boots, in two separate terminals
$ vagrant ssh
vagrant@vagrant:~$ ./start-wildfly.sh
and
$ vagrant ssh
vagrant@vagrant:~$ ./start-keycloak.sh
Then on your host, point your browser to
http://localhost:8080/photoz-html5-client/
Follow demo readme at https://github.com/ackerleytng/keycloak-quickstarts/tree/latest/app-authz-photoz#creating-and-sharing-resources
My fork is slightly different from upstream in that there are some fixes and extra debugging printouts
My setup, in case you need to troubleshoot:
- Using virtualbox for vagrant
- My
uname -a
:Linux ackerleytng 5.6.6-arch1-1 #1 SMP PREEMPT Tue, 21 Apr 2020 10:35:16 +0000 x86_64 GNU/Linux
- vagrant will be using ports 8080, 8180, and 9990, so don't listen on those on your host
The idea here is that you'll have to change live config in the wildfly server.
$ $WILDFLY_HOME/bin/jboss-cli.sh --connect
[standalone@localhost:9990 /] # Let the console print up to DEBUG
[standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level, value=DEBUG)
{"outcome" => "success"}
[standalone@localhost:9990 /] # Specify log level = DEBUG for keycloak adapters only
[standalone@localhost:9990 /] /subsystem=logging/logger=org.keycloak.adapters:add(level=DEBUG)
{"outcome" => "success"}
[standalone@localhost:9990 /] # Also enable access logs in undertow
[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/setting=access-log:add(pattern="%h %t \"%r\" %s \"%{i,User-Agent}\"",use-server-log=true)
{"outcome" => "success"}
[standalone@localhost:9990 /]
To remove
$ $WILDFLY_HOME/bin/jboss-cli.sh --connect
[standalone@localhost:9990 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level, value=INFO)
{"outcome" => "success"}
[standalone@localhost:9990 /] /subsystem=logging/logger=org.keycloak.adapters:remove()
{"outcome" => "success"}
[standalone@localhost:9990 /] /subsystem=undertow/server=default-server/host=default-host/setting=access-log:remove()
{"outcome" => "success"}
[standalone@localhost:9990 /]
You can do the same on the keycloak server, which is also running on wildfly
$ $KEYCLOAK_HOME/bin/jboss-cli.sh --connect --controller=localhost:10090
[standalone@localhost:10090 /] # Let the console print up to DEBUG
[standalone@localhost:10090 /] /subsystem=logging/console-handler=CONSOLE:write-attribute(name=level, value=DEBUG)
{"outcome" => "success"}
[standalone@localhost:10090 /] # Specify log level = DEBUG for keycloak adapters only
[standalone@localhost:10090 /] /subsystem=logging/logger=org.keycloak.authorization:add(level=DEBUG)
{"outcome" => "success"}
[standalone@localhost:10090 /] # Also enable access logs in undertow
[standalone@localhost:10090 /] /subsystem=undertow/server=default-server/host=default-host/setting=access-log:add(pattern="%h %t \"%r\" %s \"%{i,Host}\"",use-server-log=true)
{"outcome" => "success"}
[standalone@localhost:10090 /]
If you want to dump EVERYTHING from undertow,
/subsystem=undertow/configuration=filter/custom-filter=request-dumper:add(class-name="io.undertow.server.handlers.RequestDumpingHandler", module="io.undertow.core")
/subsystem=undertow/server=default-server/host=default-host/filter-ref=request-dumper:add