Ujwol Shrestha

Tech Tip – How to customize landing page for different user based on user attribute

Blog Post created by Ujwol Shrestha Employee on May 30, 2018
USE CASE :
  • If the value of the userattribute “businessCategory” is YES, redirect the user to “/home/manager.html ” after authentication.
  • If the value of the userattribute “buesinessCategory” is not YES, redirect the user to “/home/engineer.html” after authentication.
INSTRUCTIONS :
  • Create Realm for /home/ with the following three Rules :
    • OnAuthAccept_Manager
    • OnAuthAccept_Engineer
    • GetPostRealm_Home
  • Create a Variable “IsManager” of type UserContext and configure to read the user property “businessCategory”

Variable_IsManager

  • Create a Response  “ManagerHome” and add Response Attribute of type “WebAgent-OnAccept-Redirect” to redirect to static URL  “/home/manager.html”Response_ManagerHome
  • Create a Response  “EngineerHome” and add Response Attribute of type “WebAgent-OnAccept-Redirect” to redirect to static URL  “/home/engineer.html”Response_EngineerHome
  • Create a GetPost Policy to authorize all users access to “/home/*” GetPost_Home
  • Create an OnAuthAccept_Manager Policy which compares the value of the variable “IsManager” to be “Yes” and then redirects to the ManagerHome Response.OnAuthAccept_Manager_1OnAuthAccept_Manager_2
  • Create an OnAuthAccept_Engineer Policy which compares the value of the variable “IsManager” to be not equal to “Yes” and then redirects to the EngineerHome Response.OnAuthAccept_Engineer_1OnAuthAccept_Engineer_2

 

TESTING :
  • Login as a user with value of the userattribute businessCategory=YESManager_Fiddler
  • Login as a user with value of the userattribute businessCategory=NOEngineer_Fiddler

Outcomes