Skip to main content

OAuth2PasswordRequestFormStrict

This is a dependency class to collect the username and password as form data for an OAuth2 password flow.

Attributes

AttributeTypeDescription
grant_typestrThe OAuth2 spec says it is required and MUST be the fixed string "password".
usernamestrusername string. The OAuth2 spec requires the exact field name "username".
passwordstrpassword string. The OAuth2 spec requires the exact field name "password".
scopestr = ""Optional string. Several scopes (each one a string) separated by spaces. E.g. "items:read items:write users:read profile openid"
client_id`strNone` = null
client_secret`strNone` = 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

NameTypeDescription
grant_typestrThe OAuth2 grant type, which must be the exact string 'password'.
usernamestrThe username string provided in the form data.
passwordstrThe password string provided in the form data.
scopestr = ""A space-separated string of scopes.
client_id`strNone` = null
client_secret`strNone` = 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

NameTypeDescription
grant_typestrThe OAuth2 grant type which MUST be the fixed string "password" for this strict dependency.
usernamestrThe unique identifier for the user attempting to authenticate.
passwordstrThe secret credential associated with the username.
scopestr = ""A space-separated string of requested access permissions or scopes.
client_id`strNone` = None
client_secret`strNone` = None