The authenticate.py module#

Summary#

authenticate

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

log

Description#

Provides authentication for the user with a password or refresh token.

This module interacts with the HPS authentication service.

Module detail#

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)#

Authenticate 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, default: ‘https://localhost:8443/hps

Base path for the server to call.

realmstr, default: ‘rep’

Name of the Keycloak realm.

grant_type: str, default: ‘password’

Authentication method.

scopestr, default: ‘openid’

String containing one or more requested scopes.

client_idstr, default: ‘rep-cli’

Client type.

client_secretstr, default: None

Client secret.

usernamestr

Username.

passwordstr

Password.

refresh_tokenstr

Refresh token.

timeoutfloat, default: 10.0

Timeout in seconds.

verify: Union[bool, str]

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.

authenticate.log#