OpenIdConnect
OpenID Connect authentication class. An instance of it would be used as a dependency. Warning: this is only a stub to connect the components with OpenAPI in FastAPI, but it doesn’t implement the full OpenIdConnect scheme, for example, it doesn’t use the OpenIDConnect URL. You would need to to subclass it and implement it in your code.Parameters
str
required
The OpenID Connect URL.
str | None
default:"None"
Security scheme name. It will be included in the generated OpenAPI (e.g. visible at
/docs).str | None
default:"None"
Security scheme description. It will be included in the generated OpenAPI (e.g. visible at
/docs).bool
default:"True"
By default, if no HTTP Authorization header is provided, required for OpenID Connect authentication, it will automatically cancel the request and send the client an error.If
auto_error is set to False, when the HTTP Authorization header is not available, instead of erroring out, the dependency result will be None.This is useful when you want to have optional authentication or when you want to have authentication that can be provided in one of multiple optional ways (for example, with OpenID Connect or in a cookie).