UI Builder 403 Custom Page

Lo_c Guzzetta
Giga Contributor

How do you set a custom 403 page for an experience? 

 

Today, if a user is not allowed to access the page, we got a blank page with this red message: "403: You do not have permissions to access this page."

 

We would like to redirect people to another servicenow page or put a message to ask the current user to go to a specific link in order to request credentials. 
 
 
We are working in a scoped application, we don't want to update global configuration of our plateform. 
 
 
1 ACCEPTED SOLUTION

Lo_c Guzzetta
Giga Contributor

After some investigation, we choose to create a new simple page as an entry point for all users whoever they are (originally named "entry").

  • When people connect to our app they will be redirected to the "entry" page.
  • When this page load, on the "page ready" event, we check if the current user is allowed to continue (we use a custom backend transform method to do the check)
    • if they are not allowed to access the app, we show a message asking them to request some credentials via a given ServiceNow Request (we give them a link).
    • If they are allowed to continue, we redirect them to the our welcome page.
  • In order to avoid people missing around trying to access our app by forcing another URL ressource to load, on the backend, we created 2 ACLs:
    • one ux_page ACL which will check on all pages of the app (all but the "entry" page) if the current user is allowed (has credentials) to see something or not;
    • another one ux_page ACL which grant access to all snc_internal users to the "entry" page. It means that if a user bypass the entry page, they will see the oldy but goody system 403 page if he is not allowed to be there.

Feel free to give inputs if you see some flaws/issues/mistakes/improvment to do here. 

View solution in original post

3 REPLIES 3

Michael Fry1
Kilo Patron

You can try mapping the Event - Page Error and see if it redirects you but thinking this is system functionality that we can't override.

Thanks for your input Michael. Unfortunately the solution you proposed was not working (or i may have missunderstand what you were trying to imply). 
But we found another solution, check out my other comment!

Lo_c Guzzetta
Giga Contributor

After some investigation, we choose to create a new simple page as an entry point for all users whoever they are (originally named "entry").

  • When people connect to our app they will be redirected to the "entry" page.
  • When this page load, on the "page ready" event, we check if the current user is allowed to continue (we use a custom backend transform method to do the check)
    • if they are not allowed to access the app, we show a message asking them to request some credentials via a given ServiceNow Request (we give them a link).
    • If they are allowed to continue, we redirect them to the our welcome page.
  • In order to avoid people missing around trying to access our app by forcing another URL ressource to load, on the backend, we created 2 ACLs:
    • one ux_page ACL which will check on all pages of the app (all but the "entry" page) if the current user is allowed (has credentials) to see something or not;
    • another one ux_page ACL which grant access to all snc_internal users to the "entry" page. It means that if a user bypass the entry page, they will see the oldy but goody system 403 page if he is not allowed to be there.

Feel free to give inputs if you see some flaws/issues/mistakes/improvment to do here.