Skip to content

Instantly share code, notes, and snippets.

@darranl
Last active January 26, 2021 11:00
Show Gist options
  • Save darranl/d107d06fdf843d508c04e513a64e248f to your computer and use it in GitHub Desktop.
Save darranl/d107d06fdf843d508c04e513a64e248f to your computer and use it in GitHub Desktop.
# Starting Servers
bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=nodea -Djboss.socket.binding.port-offset=200
bin/standalone.sh -c standalone-ha.xml -Djboss.node.name=nodeb -Djboss.socket.binding.port-offset=300
bin/standalone.sh -c standalone-load-balancer.xml
# The servers both need to be configured the same
./nodea/bin/jboss-cli.sh -c --controller=localhost:10190
./nodea/bin/jboss-cli.sh -c --controller=localhost:10290
# Switching Servers
connect localhost:10190
connect localhost:10290
/path=test.files:add(path=/home/darranl/Tasks/ELY-1626)
/subsystem=elytron/filesystem-realm=example-realm:add(relative-to=test.files, path=Realm)
/subsystem=elytron/security-domain=example-domain:add(default-realm=example-realm, permission-mapper=default-permission-mapper,realms=[{realm=example-realm, role-decoder=groups-to-roles}]
/subsystem=elytron/http-authentication-factory=example-http-authentication:add(security-domain=example-domain, http-server-mechanism-factory=global, mechanism-configurations=[{mechanism-name=FORM}]
/subsystem=undertow/application-security-domain=other:add(http-authentication-factory=example-http-authentication)
# Adding the user only needs to be performed once.
/subsystem=elytron/filesystem-realm=example-realm:add-identity(identity=alice)
/subsystem=elytron/filesystem-realm=example-realm:add-identity-attribute(identity=alice, name=groups, value=["Users"])
/subsystem=elytron/filesystem-realm=example-realm:set-password(identity=alice, clear={password=alice})
# Single KeyStore shared by all nodes.
keytool -genkeypair -alias localhost -keyalg RSA -keysize 1024 -validity 365 -keystore SSO/keystore.jks -dname "CN=localhost" -keypass secret -storepass secret
/subsystem=elytron/key-store=example-keystore:add(path=SSO/keystore.jks, relative-to=test.files, credential-reference={clear-text=secret}, type=JKS)
/subsystem=undertow/application-security-domain=other/setting=single-sign-on:add(key-store=example-keystore, key-alias=localhost, domain=localhost, credential-reference={clear-text=secret})
# Other Commands
deploy /home/darranl/src/2021/elytron-examples/simple-webapp/target/simple-webapp.war
/subsystem=logging/logger=org.wildfly.security:add(level=TRACE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment