This is the simplest CASyfied Spring Boot application that there could be.
It could be used as a template to build more complex CAS-enabled Spring Boot apps, or simply as a quick tester for various CAS servers installations.
- Make sure you have Java 8 installed (it won't work on Java versions less than 8)
- Make sure you started CAS server.
- Change 3 required URL properties in
src/main/resources/application.yml
pointing to the desired CAS server and client host. For example:
cas:
#Required properties
server-url-prefix: https://localhost:10100/cas
server-login-url: https://localhost:10100/cas/login
client-host-url: https://localhost:8443
- Change SSL settings in
src/main/resources/application.yml
pointing to your local keystore and truststore. For example:
server:
port: 8443
ssl:
enabled: true
key-store: /etc/keystore/localhost.jks
key-store-password: changeit
gradlew clean build
- Create a keystore file
localhost
under /etc/keystore on Linux. Use C:/etc/keystore on Windows. (If you run CAS server on gradle,localhost
file must be underetc/keystore
.) - Use the password
changeit
for both the keystore and the key/certificate entries. - Ensure the keystore is loaded up with keys and certificates of the server.
- (These deploy step is not necessary for docker.)
On a successful deployment via the following methods, CAS will be available at:
https://localhost:8443/
Note: you also might need to do the self-cert generation/importing dance into the JVM's trustore for this CAS client/server SSL handshake to work properly.
For handshake exception, import crt file to jdk (cacert) of CAS-server.
If you see this error on google chrome:
Your connection is not private.
Attackers might be trying to steal your information from localhost (for example, passwords, messages, or credit cards). NET::ERR_CERT_COMMON_NAME_INVALID`
- Browse this option chrome://flags/#allow-insecure-localhost
and enable.
gradlew bootRun
Run the cas-client web application as an executable WAR.
java -jar build/libs/cas-client.war
You can build from docker-compose file.
docker-compose build
or
docker build -t tpedocker/cas-client .
docker-compose up
docker run -d -p 8443:8443 tpedocker/cas-client