How to invite customers to your portal

Created by Monica Madan, Modified on Wed, 25 Sep at 10:46 AM by Monica Madan

  • Plan Availability
  • Essential
  • Standard
  • Premium
  • Enterprise

Inviting customers to a project is a significant milestone for both the project's progress and the start of your customer's partnership with you. From the project's perspective, it signals the completion of groundwork and the transition to active collaboration, ensuring that both your team and the customers are on the same page regarding goals, expectations, and next steps. This marks the shift from planning to execution, a crucial moment that establishes transparency and accountability.


For the customer, this invitation creates a sense of inclusion and ownership. It provides visibility into the project's progress, fosters involvement, and reassures them that their needs are a priority. A well-managed invitation process, where the customer can access and understand their role in the project, helps build trust, increase engagement, and positively influence overall satisfaction.


In this article


There are three ways in which you can invite customers to projects:

1. Invite users through shared link
2. Invite users from inside the project

3. Invite users via the customer portal embedded in your website


Who can invite customers to projects?

You can now choose which customer companies gain access to your projects. For example, if you want a customer from Vance to access the customer portal, simply add “vance.com” to the “allowed domains” in Rocketlane. This allows you to control which companies can be part of your projects.


1. Only allow users with email IDs from customer domains and additional domains


To add these domains:

  • Navigate to the project settings inside a project.

  • Add the company domains of customers who can be invited to the project, for example: “vance.com.”

  • You can also add the "additional domains" while create a project in Rocketlane.

2. Users with permission can invite customers


Additionally, you can define who from your team has the permission to invite customers to the project.


3. Customers can be added via JWT


You can choose whether customers can join using the JWT token generated when they click "Join" from the embedded portal.


4. Anyone with the link can join


If you wish for anyone with the link to the customer portal to join, you can define the domains that can get access under “allowed domains.”

To set this up,


  • Navigate to your avatar and select Settings
  • In the Account settings section, select Customer portal invite configurations



To get this going,


  • Navigate to the freshly built customer portal in Rocketlane

  • From the top navigation bar, click the share button and copy the invite link to the portal

  • Now, you can share the link with any of your customers and they will be redirected to the customer portal where they will be prompted to add their email address

  • After which they will receive an email to the inbox of the email they added to verify their email and login using the magic link

  • Here if you have turned on “send invites to only users from the allowed domains” only those users can access and log into the portal


Invite users from inside the project

To invite customers to projects from the ease of your project itself, you can use the “invite button” inside the project and invite users using their email address and they will receive a magic link to join the project using which they can log into their portal


Invite users from embedded portal

Modern customer portals can seamlessly integrate within your product. By embedding a portal, your customers can access it without feeling like they are navigating away from your product. This guide will show you how to achieve this using Rocketlane.


How to Embed your portal


You can embed the customer portal in your website by following these steps


1. Embedding the Portal Code


To embed the customer portal into your product, add the following HTML snippet:

<iframe src="https://acme.rocketlane.com/cp/embed?token=<jwt_token>">
<a href="https://acme.rocketlane.com/cp/embed?token=<jwt_token>">
Go to Portal
</a>


>

Where, <a href="https://onboarding.acme.com/cp/embed?token=<jwt_token>">Go to Portal</a> is the snippet used to add a button that directs customers to the portal.

Using JWT Tokens for Seamless Login


JWT (JSON Web Tokens) provides a secure and streamlined way for users to log into the customer portal. By integrating JWT login, customers can access the portal directly through your product without needing email invitations. This method enhances the user experience by allowing single-click access.


2.1 How JWT Authentication Works

When a user tries to access the customer portal, the system uses a JWT token to authenticate their login. The token is generated for each user and verifies their identity, granting them access to the portal. Rocketlane supports two methods for generating and using these tokens: shared secret keys and public/private keys.


Shared Secret Key

Rocketlane will generate a shared secret key that you store securely. Each time a user attempts to access the customer portal, this key is used to authenticate them.


Public/Private Key

For increased security, you can use a public/private key pair:


Generate a Public Key: Create a public key at your end and add it to Rocketlane.

Authorize with Private Key: When a user attempts to log in, Rocketlane uses the public key to verify their identity. You authenticate the user with your private key.


Note: This jwt token code in the HTML snippet has to be sent from your backend and in the next steps we will talk about how to fetch that information.


2.2 Generating a JWT Token

Here’s a Python example of how to generate a JWT token on your server:

import jwt

def generate_jwt_token(your_private_key, email):
# Define payload
payload = {
"user": {
"emailId": email_id,
},
"config": {
"projectId": project_id,
// This is an optional prop. If you want to invite the user if they are not already present in the project
"inviteIfAbsent": True
},
"exp": expires_at
}

# Generate JWT token
jwt_token = jwt.encode(payload, your_private_key, algorithm=HS256)
return jwt_token

Note: Here, invite Users if Absent: The inviteIfAbsent field is optional but useful if you want to invite users who aren’t already part of the project.


The generate_jwt_token function in the above code generates and returns a JWT token if provided with the following parameters:

1. email : the email of the customer who is trying to activate the portal, 

2. project_id : the project id they should join

3. your_private_key : the private key you generate for them.

Next, let’s see how to get the project ID that is dynamically fetched and used within the JWT token for authentication or access purposes.


2.3 Get Project ID


To generate the project ID needed for the JWT token, you can use the GET Project API to fetch the relevant project details. For instance, to fetch the project ID for a specific customer company, you can use the GET Project API by filtering the projects based on the company ID.

To Fetch Project ID by Company ID: Use the GET API to filter projects by the company ID, and retrieve the project ID for the specific company.

http GET 'https://api.rocketlane.com/api/1.0/projects?companyId=<YourCompanyId>' \

accept:application/json \

api-key:<your_rl_api_key>



Where,

  1. Endpoint: https://api.rocketlane.com/api/1.0/projects 

  2. Query Parameter: Changed from companyName=YourCompanyName to companyId=<YourCompanyId>.

  3. Make sure to replace <YourCompanyId> with the actual ID of your company and <your_rl_api_key> with your actual Rocketlane API key.

  4. Headers:

    • accept: application/json to specify that you expect JSON responses.

    • api-key: <your_rl_api_key> where <your_rl_api_key> should be replaced with your actual API key.


Read more about Rocketlane APIs here.

By embedding your customer portal and using JWT tokens for authentication, you can provide a seamless and secure login experience for your customers. Whether you choose to use a shared secret key or a public/private key pair, Rocketlane makes it easy to integrate these features into your product.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

Contact our support team

Have more questions? Paid users can log in and email or chat with us.

Start your free trial