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:
bosdyn.client.exceptions.ResponseError
General class of errors for AuthResponseError service.
-
exception
bosdyn.client.auth.
InvalidLoginError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.auth.AuthResponseError
Provided username/password is invalid.
-
exception
bosdyn.client.auth.
InvalidTokenError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.auth.AuthResponseError
Provided user token is invalid or cannot be re-minted.
-
exception
bosdyn.client.auth.
TemporarilyLockedOutError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.auth.AuthResponseError
User is temporarily locked out of authentication.
-
exception
bosdyn.client.auth.
ExpiredApplicationTokenError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.auth.AuthResponseError
Application token has expired. Please contact support@bostondynamics.com to receive a new one.
-
exception
bosdyn.client.auth.
InvalidApplicationTokenError
(response, error_message=None)[source]¶ Bases:
bosdyn.client.auth.AuthResponseError
The Application Token is invalid.
-
class
bosdyn.client.auth.
AuthClient
(name=None)[source]¶ Bases:
bosdyn.client.common.BaseClient
Client to authenticate to the robot.
-
default_service_name
= 'auth'¶
-
service_type
= 'bosdyn.api.AuthService'¶
-
auth
(username, password, app_token=None, **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.
app_token – Deprecated. Only include for robots with old software.
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, app_token=None, **kwargs)[source]¶ Asynchronously authenticate to the robot with a username/password combo.
See auth documentation for more details.
-
auth_with_token
(token, app_token=None, **kwargs)[source]¶ Authenticate to the robot using a previously created user token.
- Parameters
token – a user token previously issued by the robot.
app_token – Deprecated. Only include for robots with old software.
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.
-