In today’s world, securing sensitive information like passwords and credentials is crucial. Zoho Vault offers a robust solution for storing and managing secrets securely. In this blog, we’ll walk you through how to integrate Zoho Vault, enabling secure storage and retrieval of credentials.
Zoho Vault is a cloud-based password management solution that helps securely store and share passwords and other sensitive data. It offers features like encryption, secure sharing, and access control, making it an ideal choice for teams and businesses.
To interact with Zoho Vault, you need to configure API access. Follow these steps to get your API credentials:
ZohoVault.secrets.CREATE, ZohoVault.secrets.UPDATE, ZohoVault.secrets.READ, ZohoVault.secrets.DELETE
Scopes are essentially permission sets that allow your API to perform specific actions on Zoho Vault. Once you’ve selected the scopes, generate them in the console.
To securely access Zoho Vault from your Java application, you need an access token for authenticating your API requests. The access token, however, is valid only for a short period (usually 1 hour). To avoid re-authenticating every time, you will also get a refresh token, which allows you to request new access tokens as needed.
Here’s a detailed explanation of how to obtain the refresh token:
➡️ Exchange Authorization Code for Access and Refresh Tokens
After you’ve obtained the authorization code (as explained in the previous step), you can exchange it for both an access token and a refresh token by making a POST request to Zoho’s token endpoint.
Request URL:
https://accounts.zoho.in/oauth/v2/token //.in is only for India location
Request Parameters:
You will need to pass the following parameters to the token endpoint:
code=<your authorization code> client_id=<your client ID> client_secret=<your client secret> grant_type=authorization_code redirect_uri=<your redirect URI>
Example Request (using curl):
Response Example:
{ "access_token": "1000.xxxx", "refresh_token": "1000.yyyy", "expires_in": 3600, "token_type": "Bearer" }
➡️ Use the Refresh Token to Get a New Access Token
Once the access token expires, use the refresh token to obtain a new one without needing to repeat the authentication process.:
Request URL:
https://accounts.zoho.in/oauth/v2/token
Request Parameters:
client_id=<your client ID> client_secret=<your client secret> refresh_token=<your refresh token> grant_type=refresh_token
Example Request (using curl):
Response Example:
{ "access_token": "1000.newaccessxxxx", "expires_in": 3600, "token_type": "Bearer" }
Now that you have your access token, you’re ready to make authenticated API calls to Zoho Vault. However, to store credentials in Zoho Vault, you will also need two crucial pieces of information:
Here’s how you can retrieve these values using Zoho Vault APIs:
1. Retrieve Policy ID
To fetch the Policy ID (password policy), make an API call to the Zoho Vault endpoint that provides available password policies. You’ll need to pass the access token in the header for authentication.
Request URL:
https://vault.zoho.in/api/json/secrets?OPERATION_NAME=GET_PASSWORD_POLICIES
Headers:
Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN
The POLICY_ID is the unique identifier for the password policy, which you’ll need for storing credentials.
2. Retrieve Secret Type ID
Next, to retrieve the Secret Type ID (for example, whether you’re storing a password, key, or document), make an API call to the Zoho Vault endpoint that lists available secret types.
Request URL:
https://vault.zoho.in/api/rest/json/v1/secrettypes
Headers:
Authorization: Zoho-oauthtoken YOUR_ACCESS_TOKEN
From response, you will need to select the secret type ID from the Web Account Section.
You’ll need to store the following in your code, as they will be used in every Zoho API call: your Client ID, Client Secret, Policy ID, Secret Type ID, and Refresh Token. These values will be required for authentication and authorization when interacting with Zoho Vault.
When integrating Zoho Vault with Java, it’s essential to understand two key concepts: **Secrets** and **Chambers**. These terms refer to how sensitive information is stored and organized within Zoho Vault.
A Secret in Zoho Vault refers to any sensitive information that you want to securely store, manage, and share. This could be login credentials (usernames and passwords), API keys, credit card information, or any other confidential data.
Each Secret is encrypted and protected using strong encryption methods, ensuring that only authorized users can access or decrypt it. In Zoho Vault, a Secret can be categorized into different secret types, such as:
Every Secret includes metadata such as:
A Chamber in Zoho Vault is like a secure folder or vault where you can store and organize multiple secrets. Chambers help categorize secrets based on departments, teams, or projects, making it easier to manage large amounts of sensitive data.
Think of a Chamber as a logical grouping that allows you to:
Summary:
By organizing your secrets into Chambers, you can maintain security, ensure proper access controls, and simplify the management of sensitive information within Zoho Vault.
POST https://vault.zoho.in/api/rest/json/v1/secrets
Request Format:
You need to select x-www-form-urlencoded as the request type. The body of your request will contain a single key-value pair:
Example:
GET SECRETE BY ID
CREATE CHAMBER
Note:
When you manually add credentials using the Zoho Vault UI, you can see the data in plain text. This is because Zoho Vault handles the encryption and decryption automatically when you use the web interface. However, when you’re interacting with Zoho Vault via the API, things work a bit differently due to the Host-proof Hosting (HPH) model, which is why you’re seeing encrypted data.
1. Using Zoho Vault UI (Manual Entry):
When you add credentials (like username and password) manually through the Zoho Vault UI, Zoho handles the encryption and decryption seamlessly. The data is shown to you in plain text because the encryption happens in the background, and the UI decrypts the data for display.
2. Using Zoho Vault API (Programmatic Entry):
When you use the API to save credentials, Zoho expects you to encrypt the data before sending it to their servers. Since Zoho Vault does not perform encryption or decryption when using the API, it will only store and show the encrypted data on the UI.
The reason Zoho Vault displays the data in encrypted form in the UI is that it doesn’t have the decryption key to display the data in plain text.
Zoho Vault offers a powerful solution for securely storing and managing sensitive information such as passwords, API keys, and documents. By integrating Zoho Vault, you can leverage its robust features, including encryption, secure sharing, and detailed access controls, to protect critical data.
In this guide, we’ve walked through the steps to set up Zoho Vault API access, obtain authentication tokens, and manage your secrets securely. We’ve also highlighted the concepts of secrets and chambers, which are essential for organizing and controlling access to sensitive information.
With Zoho Vault, you can ensure that your credentials are protected, stored with strong encryption, and organized in a way that aligns with your security policies. Whether used individually or by teams, Zoho Vault provides an efficient and secure method to manage sensitive data while maintaining privacy and access control. By following this guide, you can enhance your organization’s security posture, ensuring that only authorized users can access critical information while keeping it secure from unauthorized access.
The team at Mindbowser was highly professional, patient, and collaborative throughout our engagement. They struck the right balance between offering guidance and taking direction, which made the development process smooth. Although our project wasn’t related to healthcare, we clearly benefited...
Founder, Texas Ranch Security
Mindbowser played a crucial role in helping us bring everything together into a unified, cohesive product. Their commitment to industry-standard coding practices made an enormous difference, allowing developers to seamlessly transition in and out of the project without any confusion....
CEO, MarketsAI
I'm thrilled to be partnering with Mindbowser on our journey with TravelRite. The collaboration has been exceptional, and I’m truly grateful for the dedication and expertise the team has brought to the development process. Their commitment to our mission is...
Founder & CEO, TravelRite
The Mindbowser team's professionalism consistently impressed me. Their commitment to quality shone through in every aspect of the project. They truly went the extra mile, ensuring they understood our needs perfectly and were always willing to invest the time to...
CTO, New Day Therapeutics
I collaborated with Mindbowser for several years on a complex SaaS platform project. They took over a partially completed project and successfully transformed it into a fully functional and robust platform. Throughout the entire process, the quality of their work...
President, E.B. Carlson
Mindbowser and team are professional, talented and very responsive. They got us through a challenging situation with our IOT product successfully. They will be our go to dev team going forward.
Founder, Cascada
Amazing team to work with. Very responsive and very skilled in both front and backend engineering. Looking forward to our next project together.
Co-Founder, Emerge
The team is great to work with. Very professional, on task, and efficient.
Founder, PeriopMD
I can not express enough how pleased we are with the whole team. From the first call and meeting, they took our vision and ran with it. Communication was easy and everyone was flexible to our schedule. I’m excited to...
Founder, Seeke
We had very close go live timeline and Mindbowser team got us live a month before.
CEO, BuyNow WorldWide
If you want a team of great developers, I recommend them for the next project.
Founder, Teach Reach
Mindbowser built both iOS and Android apps for Mindworks, that have stood the test of time. 5 years later they still function quite beautifully. Their team always met their objectives and I'm very happy with the end result. Thank you!
Founder, Mindworks
Mindbowser has delivered a much better quality product than our previous tech vendors. Our product is stable and passed Well Architected Framework Review from AWS.
CEO, PurpleAnt
I am happy to share that we got USD 10k in cloud credits courtesy of our friends at Mindbowser. Thank you Pravin and Ayush, this means a lot to us.
CTO, Shortlist
Mindbowser is one of the reasons that our app is successful. These guys have been a great team.
Founder & CEO, MangoMirror
Kudos for all your hard work and diligence on the Telehealth platform project. You made it possible.
CEO, ThriveHealth
Mindbowser helped us build an awesome iOS app to bring balance to people’s lives.
CEO, SMILINGMIND
They were a very responsive team! Extremely easy to communicate and work with!
Founder & CEO, TotTech
We’ve had very little-to-no hiccups at all—it’s been a really pleasurable experience.
Co-Founder, TEAM8s
Mindbowser was very helpful with explaining the development process and started quickly on the project.
Executive Director of Product Development, Innovation Lab
The greatest benefit we got from Mindbowser is the expertise. Their team has developed apps in all different industries with all types of social proofs.
Co-Founder, Vesica
Mindbowser is professional, efficient and thorough.
Consultant, XPRIZE
Very committed, they create beautiful apps and are very benevolent. They have brilliant Ideas.
Founder, S.T.A.R.S of Wellness
Mindbowser was great; they listened to us a lot and helped us hone in on the actual idea of the app. They had put together fantastic wireframes for us.
Co-Founder, Flat Earth
Ayush was responsive and paired me with the best team member possible, to complete my complex vision and project. Could not be happier.
Founder, Child Life On Call
The team from Mindbowser stayed on task, asked the right questions, and completed the required tasks in a timely fashion! Strong work team!
CEO, SDOH2Health LLC
Mindbowser was easy to work with and hit the ground running, immediately feeling like part of our team.
CEO, Stealth Startup
Mindbowser was an excellent partner in developing my fitness app. They were patient, attentive, & understood my business needs. The end product exceeded my expectations. Thrilled to share it globally.
Owner, Phalanx
Mindbowser's expertise in tech, process & mobile development made them our choice for our app. The team was dedicated to the process & delivered high-quality features on time. They also gave valuable industry advice. Highly recommend them for app development...
Co-Founder, Fox&Fork