JWT Auth

JSON Web Tokens (JWT) help secure communication between two systems. Signing a JWT allows the receiver to trust the sender or "issuer". This process provides a stateless approach to authentication. A key, secret, and connection string are created for you when you create a new hyper cloud application.

Don't share your secret or connection string!

Hyper uses the HS algorithm. HS algorithms require sharing a secret. Remember to keep the secret and connection string in a secure place. DO NOT SHARE ON VERSION CONTROL. DO NOT STORE IN YOUR SOURCE CODE WHERE IT CAN BE EXPOSED ON THE CLIENT SUCH AS THE WEB BROWSER.

When making raw HTTP calls using a utility such as cURL, you won't have the ability to use hyper-connect. Here's how to create a JSON Web Token (JWT) using your hyper cloud application's connection string and NodeJS.

Example hyper cloud app keys
Example hyper cloud app keys
  • Create a .env file. Within the .env file, create an environment variable named HYPER.
  • Paste the connection string as the value of the HYPER environment variable:
JS
  • Install the following dependencies using npm or yarn:
    • dotenv
    • jsonwebtoken
Node.js

Once you have created a JWT, you can use it as a Bearer token in the Authorization header. See the cURL example in our Authorization guide.

๏ปฟ