Walled in by the wonderful Wonderwall
Basic toy API in Ktor that showcases usage of Wonderwall from a backend application's point of view. This is not a production-ready application.
Requires (almost) all requests received to contain a Bearer token issued by the configured Identity Provider.
- Expects the token to contain a claim
audwith a value that matches the client ID of the application's client. - Supports the On-Behalf-Of flow.
- Supports the Client Credentials flow.
- Expects the token to contain a claim
audwith a value that matches the client ID of the application's client. - Supports Token Exchange using TokenX.
- Requires login with Azure AD.
- API for fetching machine-to-machine tokens from Maskinporten.
Common endpoints for all identity providers:
/internal/*- unauthenticatedGET /internal/is_aliveGET /internal/is_ready
/api/*- requires a Bearer JWT access token in theAuthorizationheaderGET /api/headers- prints all headers in the requestGET /api/me- prints all claims for the authenticated user's token
/api/*- requires a Bearer JWT access token in theAuthorizationheaderGET /api/obo?aud=<cluster>:<namespace>:<app>- exchanges the authenticated user's token for the givenaud(audience)GET /api/m2m?aud=<cluster>:<namespace>:<app>- returns a machine-to-machine token for the givenaud(audience)
/api/*- requires a Bearer JWT access token in theAuthorizationheaderGET /api/obo?aud=<cluster>:<namespace>:<app>- exchanges the authenticated user's token for the givenaud(audience)
/api/*- requires a Bearer JWT access token in theAuthorizationheaderGET /api/token[?scope=nav:test/api]- returns a machine-to-machine token with the given scopeGET /api/introspect[?scope=nav:test/api]- returns the introspection result for a machine-to-machine token with the given scope
Requires JDK installed, minimum version 21.
make azureor
make idportenor
make maskinportenThis starts up required dependencies with docker-compose:
- wonderwall @ http://localhost:4000 (reverse proxy for openid connect)
- texas @ http://localhost:3000 (token exchange / introspection service)
- mock-oauth2-server @ http://localhost:7070 (mock identity provider)
and then runs Wonderwalled for the chosen identity provider.
Visit the endpoints at localhost:4000 (i.e. via Wonderwall as a reverse proxy):