OAuth2PasswordRequestForm
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 | None` = None |
| 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. |
| scopes | list[str] | A list of strings representing the individual scopes extracted from the space-separated scope string provided in the form data. |
| client_id | `str | None` = None |
| client_secret | `str | None` = None |
Constructor
Signature
def OAuth2PasswordRequestForm(
grant_type: str | None = None,
username: str,
password: str,
scope: str = "",
client_id: str | None = None,
client_secret: str | None = None
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| grant_type | `str | None` = None |
| username | str | The username string required by the OAuth2 specification. |
| password | str | The password string required by the OAuth2 specification. |
| scope | str = "" | A space-separated string of scopes which is parsed into a list of individual scope strings. |
| client_id | `str | None` = None |
| client_secret | `str | None` = None |
Signature
def OAuth2PasswordRequestForm(
grant_type: str | None = None,
username: str,
password: str,
scope: str = "",
client_id: str | None = None,
client_secret: str | None = None
)
Parameters
| Name | Type | Description |
|---|---|---|
| grant_type | `str | None` = None |
| username | str | The user's unique identifier required by the OAuth2 specification. |
| password | str | The user's secret password string used for authentication. |
| scope | str = "" | A space-separated string of requested access permissions to be parsed into a list of scopes. |
| client_id | `str | None` = None |
| client_secret | `str | None` = None |