OAuth2PasswordRequestFormStrict
This is a dependency class to collect the username and password as form data for an OAuth2 password flow.
Attributes
| Attribute | Type | Description |
|---|---|---|
| grant_type | str | The OAuth2 spec says it is required and MUST be the fixed string "password". |
| username | str | username string. The OAuth2 spec requires the exact field name "username". |
| password | str | password string. The OAuth2 spec requires the exact field name "password". |
| scope | str = "" | Optional string. Several scopes (each one a string) separated by spaces. E.g. "items:read items:write users:read profile openid" |
| client_id | `str | None` = null |
| client_secret | `str | None` = null |
Constructor
Signature
def OAuth2PasswordRequestFormStrict(
grant_type: str,
username: str,
password: str,
scope: str = "",
client_id: str | None = null,
client_secret: str | None = null
)
Parameters
| Name | Type | Description |
|---|---|---|
| grant_type | str | The OAuth2 grant type, which must be the exact string 'password'. |
| username | str | The username string provided in the form data. |
| password | str | The password string provided in the form data. |
| scope | str = "" | A space-separated string of scopes. |
| client_id | `str | None` = null |
| client_secret | `str | None` = null |
Signature
def OAuth2PasswordRequestFormStrict(
grant_type: str,
username: str,
password: str,
scope: str = "",
client_id: str | None = None,
client_secret: str | None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| grant_type | str | The OAuth2 grant type which MUST be the fixed string "password" for this strict dependency. |
| username | str | The unique identifier for the user attempting to authenticate. |
| password | str | The secret credential associated with the username. |
| scope | str = "" | A space-separated string of requested access permissions or scopes. |
| client_id | `str | None` = None |
| client_secret | `str | None` = None |