How to generate JWT token using Vonage Online JWT generator tool? How to generate JWT token using Vonage Online JWT generator tool?

How to generate JWT token using Vonage Online JWT generator tool?

Asha Chintaluru

Objective

When using Vonage APIs, your requests need to be authenticated. You can use Basic Authentication or JSON Web Tokens (JWTs)

Vonage APIs support different authentication methods depending on which product you are using. Please see the full list here

JWTs support advanced features such as ACLs(Claim used in Client SDK) and authenticate at the application level, meaning that you can access your Vonage application's settings, such as application webhooks and Secure Inbound Media.

We strongly recommend using JWT in production environments to take advantage of our platform's security and advanced capabilities.

If you use our Server SDKs to interact with the Messages API, they can automatically create JWTs for you.

You can generate a suitable JWT using the Vonage CLI or our online tool

Applies To

  • JWT token
  • Messages API: JWT token

Procedure

Please see the steps below to generate a JWT token using our Vonage Online JWT Generator tool.

 

  1. Go to your Vonage Application in your Vonage Dashboard.
  2. Select the Application you want to use.
  3. Edit the Application and click the "Generate public and private key" button as shown below. Note that you can use your own keys, but here we are showing how to generate them using the dashboard.

     

 

4. A window like the one below will pop up. Please click "Generate public and private key" from the window below.

 

5. When you click "Generate public and private key"

  •  A unique public key will be created and securely stored on your application. Please remember to save your changes to the Application.
  • A private key file(.key file) will be generated and will be automatically downloaded to your system. Please store this private key securely. You will need it to sign JWTs and authenticate your Application.
  • If the private key is lost,  you will need to generate a new key pair.

 

6. Now open the Vonage Online JWT Generator

  •  Locate the .key file of your private key in your downloads and open it with a Text Editor. If you are using a Mac, you can open it with TextEdit.
  • Copy the private key from "BEGIN" to "END".
  • and paste it in the "Private Key" box as shown below in the online Generator tool
  • Also, put your Application ID, which can be found on your Vonage Dashboard application page
  • Select the validity period.  I have selected 24 hours below, and your JWT token will be generated for you, and you can see the same on the left side box under "Your JWT"
  • You can use this token to authenticate API requests by including it in the Authorisation header using the Bearer schema.

 

Additional Information

Authentication