SecurityScheme
- class SecurityScheme(d: dict[str, Any] = None, type: SecuritySchemeType = None, description: str = None, name: str = None, location: ParameterLocation = None, scheme: str = None, bearerFormat: bool = None, flows: OAuthFlows = None, openIdConnectUrl: str = None)
Defines a security scheme that can be used by the operations.
Supported schemes are: * HTTP authentication * an API key (either as a header, a cookie parameter or as a query parameter) * mutual TLS (use of a client certificate) * OAuth2’s common flows (implicit, password, client credentials and authorization code) as defined in RFC6749, and [[OpenID-Connect-Core]].
Please note that as of 2020, the implicit flow is about to be deprecated by OAuth 2.0 Security Best Current Practice. Recommended for most use cases is Authorization Code Grant flow with PKCE.
- property type: SecuritySchemeType
REQUIRED. The type of the security scheme. Valid values are “apiKey”, “http”, “mutualTLS”, “oauth2”, “openIdConnect”.
- property description: str | None
A description for security scheme. CommonMark syntax MAY be used for rich text representation.
- property name: str | None
REQUIRED (FOR APIKEY). The name of the header, query or cookie parameter to be used.
- property location: ParameterLocation | None
REQUIRED FOR APIKEY. The location of the API key. Valid values are “query”, “header”, or “cookie”.
- property scheme: str | None
REQUIRED FOR HTTP AUTH. The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive, as defined in RFC7235.
- property bearerFormat: str | None
A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
- property flows: OAuthFlows | None
REQUIRED FOR OAUTH2. An object containing configuration information for the flow types supported.
- property openIdConnectUrl: str | None
REQUIRED FOR OPENIDCONNECT. Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata.