Security callbacks
Instead of providing credentials once during SDK instantiation, pass a custom authentication function that allows end users to manage secrets dynamically. Custom authentication functions can be used to automatically refresh tokens or retrieve secrets from a secret store.
Language support
Language | Status |
---|---|
TypeScript | ✅ |
Python | ✅ |
Go | ✅ |
C# | ✅ |
Java | ✅ |
PHP | ✅ |
Swift | 🏗️ |
Ruby | ✅ |
Example: Bearer authentication
In this example, bearer authentication is used as the only security scheme:
security:- bearerAuth: []components:securitySchemes:bearerAuth:type: httpscheme: bearer
The callback function passed when initializing the SDK acts as a security source and is called whenever a request is made, allowing tokens to be refreshed if needed.
Last updated on