Embed (Trusted Authentication System)

 > Embed > Embed (Trusted Authentication System)

You can embed Dashboards in your site using the HTML <iframe> Tag.


This method Secure Embed works with a Trusted Authentication System.

How to Secure Embed #

1º Make an API request of the type GET to the Viur Authentication system:

As a pre-requisite to make Secure Embed you need to create a Personal Access Token, learn how to create one here.

POST https://app.viurdata.com/authentication?username=(:username)

Change the parameter ?username= (:username) to an existing user e-mail in your Viur Team that you wish to authenticate.

Important Note
A Key named "Authorization" with the Value "Bearer (your created Personal Access Token)" should be added to Header section of the request.
You can learn more about Viur API requests here.

The response of the Request will return a token that is valid for 3 minutes (by default) that can be used to Authenticate automatically the user in question (:username).


2º Create an iframe with the obtained token:

To embed your Dashboard you need to obtain the Dashboard ID easily obtained in the URL while viewing a Dashboard.



Also make sure the token you created is made from a User that has access to the Dashboard you want to embed.
Learn how to give permissions to a user here.


Take a look at this example:


Use the attributes width and height to set the iframe to a size of your liking.

You need to change:

  • (dashboardID) to the ID of the Dashboard you want to embed.
  • (token) to the response you got in the API Request of the 1º Step.


You can control the initial values of the variables of the dashboard by GET parameters in the URL like so:

Example iframe:


There are two error outcomes:

The user in question does not have permissions to see the Dashboard:

Make sure the user in question has permissions.

The token is invalid or expired:

Fix this by generating another token or check if it was pasted correctly in the URL.


Still need help? Get in touch!
Last updated on 9th Dec 2023