client.authenticate#

This module provides authentication for the user with a password or refresh token against the HPS authentication service.

Attributes#

log

Functions#

authenticate([url, realm, grant_type, scope, ...])

Authenticates the user with a password or refresh token against the HPS authentication service.

Module Contents#

client.authenticate.log#
client.authenticate.authenticate(url: str = 'https://localhost:8443/hps', realm: str = 'rep', grant_type: str = 'password', scope='openid', client_id: str = 'rep-cli', client_secret: str = None, username: str = None, password: str = None, refresh_token: str = None, timeout: float = 10.0, verify: bool | str = True, **kwargs)#

Authenticates the user with a password or refresh token against the HPS authentication service.

If this method is successful, the response includes access and refresh tokens.

Parameters:
urlstr, optional

Base path for the server to call. The default is 'https://localhost:8443/rep'.

realmstr, optional

Keycloak realm. The default is 'rep'.

grant_type: str, optional

Authentication method. The default is 'password'.

scopestr, optional

String containing one or more requested scopes. The default is 'openid'.

client_idstr, optional

Client type. The default is 'rep-cli'.

client_secretstr, optional

Client secret. The default is None.

usernamestr, optional

Username.

passwordstr, optional.

Password.

refresh_tokenstr, optional

Refresh token.

timeoutfloat, optional

Timeout in seconds. The default is 10.0.

verify: Union[bool, str], optional

If a Boolean, whether to verify the server’s TLS certificate. If a string, the path to the CA bundle to use. For more information, see the requests.Session documentation.

Returns:
dict

JSON-encoded content of a requests.Response object.