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.
- Go to your Vonage Application in your Vonage Dashboard.
- Select the Application you want to use.
-
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
Articles in this section
- Why is my WhatsApp Messaging Limit still at 250 and Display Name not visible after Business Verification?
- WhatsApp Display Name – Approval, Review & Appeal Process
- Understanding WhatsApp Usernames and Business-Scoped User IDs (BSUIDs) – Required Actions and Changes
- Understanding the "Business Verification Needed.." Message in WhatsApp Manager for Restricted WABA Accounts
- WhatsApp Business Account Locked - Error 1330
- WhatsApp Vonage Managed Manual Onboarding Form No Longer Available for partners
- What to do if you see "The new display name has been approved. Register your number to start using it"?
- What is the 24-Hour Customer Care Window
- How to generate JWT token using Vonage Online JWT generator tool?
- Getting started with Vonage's WhatsApp Business Account : Hosted Embedded Sign-Up for Partners' End Customers