Be sure to review our visitor SSO implementation tutorial as well.
First, build the sample application from source:
Build from source
./gradlew bootRun
The following command runs the sample application on port 8080 in a Docker container:
Run using Docker
docker run --rm -p 8080:8080 ghcr.io/unblu/unblu-visitor-sso-sample
Then open http://localhost:8080.
cURL samples
# List generated JWKs
curl -s localhost:8080/api/jwk | jq
# Issue a new JWT
curl -X POST \
-H "Content-Type: application/json" \
-d '{"username": "pmuster", "email": "[email protected]", "firstname": "Peter", "lastname": "Muster"}' \
localhost:8080/api/token | jq
The sample application’s configuration property unblu.serverUrl
must point to a running Unblu installation.
JWT based visitor SSO must be enabled on the Unblu server.
Change
src/main/resources/application.properties
to reconfigure the sample applicationlink:src/main/resources/application.properties[role=include]
Public key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqbeMNPQqAReFENmE6/Z9
S4yWYyL543hO1KBsCa8RBcVIUzGkWO06N4mDMR+jWlMMAAUreK28pHmRQb7rOKEQ
VanIrAV8z/PlEl/btXLobXjRqr16VbMNGHroSGImE05MwHBR04v6SQ63XaTlTJ6Q
irTvvqHnOyC4Tjksa8aAYxYOCAnSSM/n5BgdIcXs/16esTadrHxL+VC4Y8Y71114
4Orw9LtwQrfgcUYaUaT0cGz5sBnlmP7Iz7bQV4TyiASHIUakX0Rzs9zCSZ0KJ0SL
cZMG1oCL4GdnwsiA4iismBcRtH0pEhQoU7rjDg/umt3CEkk1wLPx+3Icvi+39xCa
dwIDAQAB
-----END PUBLIC KEY-----
Private key
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpt4w09CoBF4UQ
2YTr9n1LjJZjIvnjeE7UoGwJrxEFxUhTMaRY7To3iYMxH6NaUwwABSt4rbykeZFB
vus4oRBVqcisBXzP8+USX9u1cuhteNGqvXpVsw0YeuhIYiYTTkzAcFHTi/pJDrdd
pOVMnpCKtO++oec7ILhOOSxrxoBjFg4ICd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