Protect an API
API with Swagger UI
Swagger UI signs in with PKCE and calls the API with a token addressed to it.
Client
rKlBcs6p1rjTJQeZVKsQsBATlH…
Swagger UI, a public client
As the provider registered it (RFC 7591 §3.2.1), the API granted by the initial access token; the API verifies its tokens itself (RFC 9068)
{ "client_name": "Swagger UI of the demonstration", "token_endpoint_auth_method": "none", "grant_types": ["authorization_code"], "response_types": ["code"], "redirect_uris": ["https://oidc-demo.spk.li/bundles/apiplatform/swagger-ui/oauth2-redirect.html"], "scope": "openid invoices.read invoices.pay invoices.write"}
Proof
17:39:18
It works
- GET /api/v1/invoices → 200 at+jwt verified offline (RFC 9068), scope openid invoices.read invoices.pay invoices.write, 17:39:18
- GET /api/v1/account → 200 at+jwt verified offline (RFC 9068), scope openid invoices.read invoices.pay invoices.write, 17:38:57