developer-tools-authentication.md
For the complete documentation index, see llms.txt. This page is also available as Markdown.
The GraphQL API requires authentication for requests. Remote.It authentication uses HTTP Request Signature. The advantages of this method are:
Keys do not expire
Keys can be disabled and revoked (deleted) by the user at any time
Keys are not dependent on password
Keys are more secure (the secret is never transmitted because the request is signed)
With 2FA enabled, you'll need to provide an authentication code when accessing Remote.It through your browser, desktop and mobile apps. If you access Remote.It using other methods, such as the the CLI, you'll need to sign in with credentials using and access key and secret.
You can generate, enable, disable and delete keys in the Account section of the web portal here https://app.remote.it/#/account/accessKey.
Please note: Generation of keys is crypto-random and the secret is only available immediately after creation by clicking the “Show secret access key” link or downloading the key as a CSV file (containing the Access Key ID and Secret Access Key)
You are limited to 2 active access keys. The account page will also show when the key was created and last used for authentication. If you suspect your key has been compromised, generate a new one, replace it in your code and disable it. If desired you can delete the compromised key after disabling it.
In addition, if you will be using the REST-API you will also need to retrieve your Developer API Key. This can also be found in the Account section of the web portal.
You will need to follow the steps above with Key Management to generate your access key and secret before proceeding. Then, create a file to save your Remote.It credentials. The file name should be credentials with no extension. The folder depends on your operating system.
Operating System
Folder
Linux/macOS
~/.remoteit (in your home directory)
Windows
C:\Users[your Windows user name].remoteit
The file is in the standard ini file format:
You can save more than one key pair under different profiles (sections) in the Remote.It credentials file. DEFAULT is the default profile name. Profiles name is case sensitive and should not have a "." in the name.
Timezones
Request signing is done for each request independently and is sensitive to clock drift based on the system time of the machine making the API call.
Best practice is to use UTC or GMT when using the signature methods to avoid ambiguous time zones when dates are generated by your code.
To authenticate an API request, the client must generate a signature using the previously created key and secret. The REST-API example you will also need your Developer API Key which you can get from your account page https://app.remote.it/#account
These are examples of query requests only for the purposes of how to do the request signing. Please refer to the schema and usage documentation for requests which are supported.
bash/cURL
Node
Python 3
C#
Other Languages
The examples reads the ~/.remoteit/credentials file for the variables of your access key, secret, and developer key.
GraphQL
This typescript example shows
How to retrieve credentials from the remote.it credentials file using a default profile
Use http-signature client library to Authenticate each request
How to query GraphQL using variables and the https library
This example is using a helper library requests_http_signature==v0.7.1 for Python 3 which will sign the request before submitting it to the server. This demonstrates how to safely reference the key and secret from the ~/.remoteit/credentials file.
Reference functions create a connection and have a disconnect.
This example is a port of the bash/cURL example assuming a C# program and that you have stored your credentials in a file as indicated from the credential file generation and only ONE profile. If there is more than one, it will use the first. You could change this to load them from an environment variable instead.
You can reference different standard implementations of the signature in different languages from w3c-ccg https://github.com/w3c-ccg/http-signatures/issues/1
Last updated 14 days ago
Was this helpful?