Constructor
# new AuthClient(namenullable)
Create an instance of AuthClient's class.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string
|
<nullable> |
null | Name of the BaseClient |
Methods
# auth(username, password, app_tokenopt, nullable, argsopt) → {Promise.<string>}
Authenticate to the robot with a username/password combo.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
username |
string
|
Username on the robot. | ||
password |
string
|
Password for the username on the robot. | ||
app_token |
string
|
<optional> <nullable> |
null | Deprecated. Only include for robots with old software. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
If username and/or password are not valid.
InvalidLoginError
User token from the server as a string.
Promise.<string>
# auth_with_token(token, app_tokennullable, argsopt) → {Promise.<string>}
Authenticate to the robot using a previously created user token.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
token |
string
|
A user token previously issued by the robot. | ||
app_token |
string
|
<nullable> |
null | Deprecated. Only include for robots with old software. |
args |
Object
|
<optional> |
Extra arguments for controlling RPC details. |
If the token was incorrectly formed, for the wrong robot, or expired.
InvalidTokenError
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.
Promise.<string>