Public Page or Page Tokens

Sometimes you may need to create pages that public and not for logged in users.  For example, you may want to create a special public search page.  Or, allow a user who has an account to start a page with data with just a long URL.  This articles describes how you can create two types of public pages:

Public Page No Token: This is a public page with no token in the URL.  

Public Page with Token: This is a public page with a token in the URL (hard to guess).  Ideal for Account generated access.  Ie: A user wishes to make some data public.

Highlights

  • Custom Pages can be made usable without a Portal account
  • Pages are restricted via Account Public Tokens which are managed by Account Admins
  • Page Tokens are currently stored in the current tenant’s UP stream on client API.

Required Steps

  • Enable Public Page Tokens
  • Permission tags and stream 
  • Settings for Custom Dashboard

 

Step: Login as Super Admin

Step: Enable Public Page in Advanced Config

Click on advanced config on the nav bar.  Add "ENABLE_PUBLIC_PAGES": true, to the config.  Note the config requires JSON syntax to the comma is important.  Click HELP for more explanations.

Step: Specify PUBLIC_ENDPOINT_POLICY

For security, you should only allow public endpoints to read and write data from specific data streams or tags.  Specify the policy on the Advanced Config page.  More information on example policy under HELP.  You will need this policy if the public page is making API calls to the IoT Platform.

Step: Make Custom Page Public

For security, you should only allow public endpoints to read and write data from specific data streams or tags.  Specify the policy on the Advanced Config page.  More information on example policy under HELP.  You can specify a page to be Public with or without token.  If you did not enable Public pages in the advanced config, the options will not appear here.

Screen_Shot_2019-12-09_at_3.53.49_PM.png

If there's no token, you can see the public URL generated on the page.  Ie.

https://portal-yourportal.mediumone.com/public/test_public_page

 

Step: (Advanced) Manage Page Tokens

If you plan to user page tokens, you will need to manage the tokens via API.  Each token is granted per page and account.  Here's an example custom page to create and revoke a token.  To create a custom page, use sample code here:

Name the custom page as you like and access it within an account and it should look like this.  You should be able to create tokens.  Once a token is created, you can have the user share the token URL, etc.

Screen_Shot_2019-12-09_at_4.18.47_PM.png

The public token page URL will have the following format:

https://portal-yourportal.mediumone.com/token_page/yourpage/account_id/token