const oauth = authorizationCodeScheme({
authorizationUrl: 'https://auth.example.com/authorize',
tokenUrl: 'https://auth.example.com/token',
scopes: { 'read:items': 'Read items' },
authenticate: async (ctx) => {
// validate Bearer token from ctx.headers.authorization
return { succeeded: false };
}
});
Create an OAuth 2.0 Authorization Code authentication scheme.
The returned scheme exposes a
flowsproperty that the OpenAPI generator uses to automatically emit the correctoauth2security scheme.