Redirect to Login page always after logout in Dynamics 365 Portal

By | December 11, 2019

Introduction

In this blog, we will see how we can navigate to login page after once we logout from any page in Microsoft Portal.

Let’s look at the requirement where we want to provision the setup such as that the log-in page is redirected as soon the user logs out. Now, after logging again in the portal user is again redirected to the same page from where he logged out.

There are only 3 steps, which we need to be followed to cater the above requirement in our Dynamics 365 Portal.

Step 1

Go to the Web Template entity and search “header”.

Dynamics 365 Portal

Step 2

Open the record and find the logout section in source control.

Dynamics 365 Portal

Step 3

Update the href attribute of the anchor tag as below.

From: – href=”{% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }}”

Dynamics 365 Portal

To: –

href=”/Account/Login/LogOff?returnUrl={{ website.sign_out_url_substitution }}”

Dynamics 365 Portal

We have just replaced the homeurl with /Account/Login/LogOff?returnUrl=

Conclusion

This is the most precise way to set the login page as default page after logout.

Free 70% of storage space in CRM with Attachment Management Apps!

Attach2Dynamics – Store and manage documents/attachments in cloud storage of your choice – SharePoint, Dropbox or Azure Blob Storage from within Dynamics 365 CRM.
SharePoint Security Sync – Robust and secure solution to integrate Dynamics 365 CRM and SharePoint Security Sync thereby ensuring secure access to confidential documents stored in SharePoint.