Requirement Support user should be redirected to support page after logging in to Dynamics 365 portal instead of the home page. But later they can navigate to the home page.
Solution In order to implement this requirement, here we need to implement two checks:
To implement the first requirement, we are going to use User object here to check if current user is part of the Portal Supporting User web roles; if you are new to web roles, please refer to this KB for how to create web roles.
Now to implement the second requirement, I didn’t find any straight out of the box configuration to redirect user to a specific page after every login. Off course they will be redirected to Profile page for the first time they login. But we can implement a workaround by writing a quick javascript code to implement this requirement. We can use sessionStorage here to hold a flag to validate it. Session storage is a specific tab or page, so once it is closed, the value of the session storage is removed automatically. So we are going to use Home web template and will be using the following code on the Home template, so navigate to Portals-> Web Templates and open Home template.
Our full code should look like below,