Keycloak: Difference between revisions
Jump to navigation
Jump to search
Line 79: | Line 79: | ||
| valign="top" | | | valign="top" | | ||
* [https://www.baeldung.com/keycloak-embedded-in-spring-boot-app Keycloak Embedded in a Spring Boot Application] | * [https://www.baeldung.com/keycloak-embedded-in-spring-boot-app Keycloak Embedded in a Spring Boot Application] | ||
* [https://stackoverflow.com/questions/51499238 WildFly Management User vs Application User] | * [https://stackoverflow.com/questions/51499238 WildFly Management User vs Application User] | ||
* [https://www.keycloak.org/docs/latest/server_installation/ Server Installation and Configuration Guide] | * [https://www.keycloak.org/docs/latest/server_installation/ Server Installation and Configuration Guide] | ||
Line 91: | Line 90: | ||
| valign="top" | | | valign="top" | | ||
* [https://medium.com/devops-dudes/securing-spring-boot-rest-apis-with-keycloak-1d760b2004e Securing Spring Boot REST APIs with Keycloak] | |||
|} | |} |
Revision as of 07:15, 28 February 2021
apt update; apt list --upgradable; cd /opt/
wget https://github.com/keycloak/keycloak/releases/download/12.0.3/keycloak-12.0.3.tar.gz
tar -xvzf keycloak-12.0.3.tar.gz
mv keycloak-12.0.3 keycloak
Permission
groupadd keycloak
useradd -r -g keycloak -d /opt/keycloak -s /sbin/nologin keycloak
chown -R keycloak: /opt/keycloak/
chmod o+x /opt/keycloak/bin/
mkdir /etc/keycloak
cp /opt/keycloak/docs/contrib/scripts/systemd/wildfly.conf /etc/keycloak/keycloak.conf
cp /opt/keycloak/docs/contrib/scripts/systemd/launch.sh /opt/keycloak/bin/
chown keycloak: /opt/keycloak/bin/launch.sh
nano /opt/keycloak/bin/launch.sh
Config
#!/bin/bash
if [ "x$WILDFLY_HOME" = "x" ]; then
WILDFLY_HOME="/opt/keycloak"
fi
if [[ "$1" == "domain" ]]; then
$WILDFLY_HOME/bin/domain.sh -c $2 -b $3
else
#$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3
$WILDFLY_HOME/bin/standalone.sh -c $2 -b $3 -bmanagement=0.0.0.0
fi
Service
cp /opt/keycloak/docs/contrib/scripts/systemd/wildfly.service /etc/systemd/system/keycloak.service
nano /etc/systemd/system/keycloak.service
[Unit]
Description=The Keycloak Application Server
After=syslog.target network.target
Before=httpd.service
[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=/etc/keycloak/keycloak.conf
User=keycloak
Group=keycloak
LimitNOFILE=102642
PIDFile=/var/run/keycloak/keycloak.pid
ExecStart=/opt/keycloak/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND
StandardOutput=null
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable keycloak
systemctl start keycloak
systemctl status keycloak
tail -f /opt/keycloak/standalone/log/server.log
ssh [email protected] -L 8080:localhost:8080 -L 9990:localhost:9990 http://localhost:8080/ http://localhost:9990/