Create an OAuth 2.0 Client Credentials authentication scheme.
Used for machine-to-machine (M2M) authentication. The returned scheme exposes a flows property for automatic OpenAPI security scheme detection.
flows
const m2m = clientCredentialsScheme({ tokenUrl: 'https://auth.example.com/token', scopes: { 'service:read': 'Read service data' }, authenticate: async (ctx) => { // validate Bearer token return { succeeded: false }; }}); Copy
const m2m = clientCredentialsScheme({ tokenUrl: 'https://auth.example.com/token', scopes: { 'service:read': 'Read service data' }, authenticate: async (ctx) => { // validate Bearer token return { succeeded: false }; }});
Create an OAuth 2.0 Client Credentials authentication scheme.
Used for machine-to-machine (M2M) authentication. The returned scheme exposes a
flowsproperty for automatic OpenAPI security scheme detection.