[docs]classAccessTokenRequest(BaseModel):""" Base model for OAuth 2.0 access token request. """grant_type:str"""OAuth 2.0 grant type"""model_config=ConfigDict(extra="allow")
[docs]classAuthorizationCodeAccessTokenRequest(AccessTokenRequest):""" Request model for the access token request with the Authorization Code grant. https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.3 """grant_type:str=GrantType.AUTHORIZATION_CODEcode:str"""Authorization code received from the authorization server"""redirect_uri:Optional[str]=None"""Redirect URI"""client_id:str"""Client identifier"""
[docs]classClientCredentialsAccessTokenRequest(AccessTokenRequest):""" Request model for the access token request with the Client Credentials grant. https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.2 """grant_type:str=GrantType.CLIENT_CREDENTIALSclient_id:str"""Client identifier"""client_secret:str"""Client secret"""scope:Optional[str]=None"""Scope of the access request"""
[docs]classResourceOwnerPasswordCredentialsAccessTokenRequest(AccessTokenRequest):""" Request model for the access token request with the Resource Owner Password Credentials grant. https://datatracker.ietf.org/doc/html/rfc6749#section-4.3.2 """grant_type:str=GrantType.RESOURCE_OWNER_PASSWORD_CREDENTIALSusername:str"""Resource owner username"""password:str"""Resource owner password"""scope:Optional[str]=None"""Scope of the access request"""
[docs]classRefreshTokenAccessTokenRequest(AccessTokenRequest):""" Request model for the access token request using a Refresh Token. https://datatracker.ietf.org/doc/html/rfc6749#section-6 """grant_type:str=GrantType.REFRESH_TOKENrefresh_token:str"""Refresh token"""scope:Optional[str]=None"""Scope of the access request"""
[docs]classDeviceAccessTokenRequest(AccessTokenRequest):""" The Device Access Token Request model. https://datatracker.ietf.org/doc/html/rfc8628#section-3.4 :ivar grant_type: The grant type. Value MUST be set to "urn:ietf:params:oauth:grant-type:device_code". :ivar device_code: The device verification code, "device_code" from the device authorization response. :ivar client_id: The client identifier. """grant_type:str=GrantType.DEVICE_CODEdevice_code:str"""Device verification code"""client_id:str"""Client identifier"""
[docs]classAuthorizationRequest(BaseModel):""" The Authorization Request model. https://datatracker.ietf.org/doc/html/rfc6749#section-4.1.1 """response_type:str="code"client_id:str"""Client identifier"""redirect_uri:Optional[str]=None"""Redirect URI"""scope:Optional[str]=None"""Scope of the access request"""state:Optional[str]=None"""Opaque value used by the client to maintain state between the request and callback"""
[docs]classDeviceAuthorizationRequest(BaseModel):""" The Device Authorization Request model. https://datatracker.ietf.org/doc/html/rfc8628#section-3.1 """client_id:str"""Client identifier"""scope:Optional[str]=None"""Scope of the access request"""