Auth

For clients to acquire a user token from the authentication service.

AuthClient – Wrapper around service stub. InvalidLoginError – Raised when authentication response indicates invalid login. InvalidTokenError – Raised when authentication response indicates invalid token.

exception bosdyn.client.auth.AuthResponseError(response, error_message=None)[source]

Bases: ResponseError

General class of errors for AuthResponseError service.

exception bosdyn.client.auth.InvalidLoginError(response, error_message=None)[source]

Bases: AuthResponseError

Provided username/password is invalid.

exception bosdyn.client.auth.InvalidTokenError(response, error_message=None)[source]

Bases: AuthResponseError

Provided user token is invalid or cannot be re-minted.

exception bosdyn.client.auth.TemporarilyLockedOutError(response, error_message=None)[source]

Bases: AuthResponseError

User is temporarily locked out of authentication.

class bosdyn.client.auth.AuthClient(name=None)[source]

Bases: BaseClient

Client to authenticate to the robot.

default_service_name = 'auth'
service_type = 'bosdyn.api.AuthService'
auth(username, password, **kwargs)[source]

Authenticate to the robot with a username/password combo.

Parameters:
  • username – username on the robot.

  • password – password for the username on the robot.

  • kwargs – extra arguments for controlling RPC details.

Returns:

User token from the server as a string.

Raises:

InvalidLoginError – If username and/or password are not valid.

auth_async(username, password, **kwargs)[source]

Asynchronously authenticate to the robot with a username/password combo.

See auth documentation for more details.

auth_with_token(token, **kwargs)[source]

Authenticate to the robot using a previously created user token.

Parameters:
  • token – a user token previously issued by the robot.

  • kwargs – extra arguments for controlling RPC details.

Returns:

A new user token from the server. The new token will generally be valid further in the future than the passed in token. A client can use auth_with_token to regularly re-authenticate without needing to ask for username/password credentials.

Raises:

InvalidTokenError – If the token was incorrectly formed, for the wrong robot, or expired.

auth_with_token_async(token, **kwargs)[source]

Authenticate to the robot using a previously created user token.

See auth_with_token documentation for more details.