Example backends
Four small backends on authbase, with the same routes so one script
(smoke.sh) tests them all; CI runs every one against the compose stack.
| Stack | Port | Uses | |
|---|---|---|---|
express |
Node, Express 5 | 3001 | @authbase/node |
ktor |
Kotlin, Ktor 3 | 3002 | authbase-ktor |
spring |
Kotlin, Spring Boot 4 | 3003 | authbase-spring-boot-starter |
go |
Go, net/http | 3004 | no SDK: lestrrat-go/jwx, as in the integration guide |
| Route | |
|---|---|
POST /signup {email, password} |
creates the user in authbase and logs in → 201 {user_id, access_token, refresh_token} |
POST /login {email, password} |
→ {access_token, refresh_token} |
POST /refresh {refresh_token} |
→ a new pair; the old refresh token is dead |
POST /logout {refresh_token} |
→ 204 |
GET /me |
Bearer token → {id, email, roles}; verified locally |
GET /admin |
needs the admin role → 403 without it |
Run one
Section titled “Run one”Start authbase and get an API key (quick start), then, with the key only in your environment:
export AUTHBASE_URL=http://localhost:8080 AUTHBASE_API_KEY=sk_live_…
# Express: the SDK is used from source, so build it first(cd sdk/typescript && npm ci && npm run build) && cd examples/express && npm install && npm start# Gocd examples/go && go run .# Ktor / Spring Boot: Gradle builds the Kotlin SDK from source (includeBuild)cd examples/ktor && ./gradlew runcd examples/spring && ./gradlew bootRun
# in another shellexamples/smoke.sh http://localhost:3001For agents: this page as markdown · llms.txt