- Home
- Documentation
- Standard security schemes
Simple security schemes
Basic HTTP authentication
Section titled “Basic HTTP authentication”Basic HTTP authentication is supported in all languages.
Define type: http and scheme: basic to generate authentication that prompts users for a username and password when instantiating the SDK. The SDK will encode the username and password into a Base64 string and pass it in the Authorization header.
paths: /drinks: get: operationId: listDrinks summary: Get a list of drinks. description: Get a list of drinks, if authenticated this will include stock levels and product codes otherwise it will only include public information. tags: - drinkscomponents: securitySchemes: auth: type: http scheme: basicsecurity: - auth: []API key authentication
Section titled “API key authentication”API key authentication is supported in all languages.
Define type: apiKey and in: [header,query] to generate authentication that prompts users for a key when instantiating the SDK. The SDK passes the key in a header or query parameter, depending on the in property, and uses the name field as the header or key name.
paths: /drinks: get: operationId: listDrinks summary: Get a list of drinks. description: Get a list of drinks, if authenticated this will include stock levels and product codes otherwise it will only include public information. tags: - drinks responses: "200": description: OK #...components: securitySchemes: api_key: type: apiKey name: api_key in: headersecurity: - api_key: []Bearer token authentication
Section titled “Bearer token authentication”Bearer token authentication is supported in all languages.
Define type: http and scheme: bearer to generate authentication that prompts users for a token when instantiating the SDK.
The SDK will pass the token in the Authorization header using the Bearer scheme, appending the Bearer prefix to the token if not already present.
paths: /drinks: get: operationId: listDrinks summary: Get a list of drinks. description: Get a list of drinks, if authenticated this will include stock levels and product codes otherwise it will only include public information. tags: - drinkscomponents: securitySchemes: auth: type: http scheme: bearersecurity: - auth: []