[docs]classDirectAccessGrantClient:""" A client that implements *Direct Access Grant* (or *Resource Owner Password Credentials Grant*) functionality. It is exposed via :data:`OpenidClient.authorization_code_flow <simple_openid_connect.client.OpenidClient.direct_access_grant>`. """
[docs]defauthenticate(self,username:str,password:str)->Union[TokenSuccessResponse,TokenErrorResponse]:""" Exchange a given username and password for access, refresh and id tokens. :returns: The result of the exchange """ifself._base_client.provider_config.token_endpointisNone:raiseUnsupportedByProviderError(f"The OpenID provider {self._base_client.provider_config.issuer} only seems to support the implicit flow and does not have a token endpoint")returnimpl.authenticate(token_endpoint=self._base_client.provider_config.token_endpoint,scope=self._base_client.scope,username=username,password=password,client_authentication=self._base_client.client_auth,)