Connect your application
Quickstart: a Spring Boot application
On this page
Introduction
This guide connects a Spring Boot, on spring.io application to Signari, so that people sign in to it with their Signari account. The example, examples/spring-quickstart, on GitHub, uses Spring Security's OAuth 2.0 client for the protocol.
You register the application, run the example, and sign in. The last sections explain what the example does, and the two settings Signari needs that Spring does not assume.
Note
New to Signari? Your first application runs this example and five others on your own computer, with nothing to register by hand.
1. Register the application
Register the example as a confidential client, with Spring's callback address as its redirect URI:
Shellsignari client create -org <org-id> -client-id quickstart -name Quickstart \ -redirect http://127.0.0.1:8080/login/oauth2/code/signari
It prints the client secret once. Keep it. The redirect URI is Spring's own pattern,
/login/oauth2/code/<registration>, matched exactly.
2. Run it
Build the example, then run it with Signari's address and the values from step 1:
Shellcd examples/spring-quickstartmvn packageSIGNARI_ISSUER=https://id.example.com CLIENT_ID=quickstart CLIENT_SECRET=<the secret> \ java -jar target/spring-quickstart-1.0.0.jar
Open http://127.0.0.1:8080/, follow the link, sign in, and /me says who signed in.
Java 17 or later. For a certificate your machine does not trust, import it into a
truststore with keytool -importcert and start Java with
-Djavax.net.ssl.trustStore=<file> -Djavax.net.ssl.trustStorePassword=<password>.
In compose
The demo profile of deploy/docker-compose.yml runs this example from its
Dockerfile, on GitHub as demo-spring, the public client
demo-spring of deploy/demo/client.yaml, on GitHub, with
CLIENT_AUTH=none, at http://localhost:8094/. With the settings that Your
first application
writes to deploy/.env, start it:
Shellcd deploy && docker compose --profile first-run --profile demo up -d
Given SIGNARI_CA_FILE, the image imports that certificate into a truststore of its
own each time it starts, under a password made then, and Java trusts only it; the demo
gives it the development CA under deploy/tls. Spring reads the discovery document as
it starts, so it exits until the engine answers, and compose starts it again.
What it does, and the two settings Signari needs
application.properties names Signari by issuer-uri. Spring reads the discovery
document at start and refuses one naming another issuer. The registration uses
client_secret_basic, scopes openid email profile, and Spring's redirect pattern.
SecurityConfig adds the two things Spring does not assume:
- Proof Key for Code Exchange (PKCE) for a confidential client. Signari requires
it of every client and
accepts only
S256. Spring adds it by itself only for public clients, so the authorization request resolver is givenOAuth2AuthorizationRequestCustomizers.withPkce(). - The ID token's algorithm. Spring checks the ID token's signature against the
published keys, then its issuer, audience, expiry and nonce. It expects RS256
unless told otherwise, and Signari signs with ES256 by default. The
OidcIdTokenDecoderFactorybean names ES256. A client set to another algorithm withsignari client set-algnames that one there instead.
A public client has no secret: leave CLIENT_SECRET unset, set CLIENT_AUTH=none, and
register it with -public. A refused sign-in sends the browser to Spring's
/login?error; the engine's own message is in its log and in
Troubleshooting.
Verified
On 14 November 2026, with Java 17, Maven 3.9.16, Spring Boot 4.1.2 and Spring Security
7.1.2, against a running engine over Transport Layer Security (TLS). Ada signed in
through the engine's pages and /me said "Signed in as ada@staff.test". The engine's
access log showed /oauth2/jwks fetched for the signature. With the ES256 line taken
out, the same sign-in was refused and the browser was sent back to Spring's sign-in
page. A callback this browser never
began went to /login?error, and /me signed out sent the browser to sign in.
Since 29 November 2026, continuous integration (CI) runs this example in the compose
stack's demo profile whenever it, the stack or the engine changes, and once a week.
A new person signs in to it in Chrome, with a password and then by single sign-on,
and the run fails unless the application says "Signed in as" them. The job is
.github/workflows/quickstarts.yml.