Logout user on navigating to login page using browser back or forward button

0
Need to implement browser back and forward button functionality, when a user navigates to the login page using these browser buttons, the user should be logged out from the application. Additionally, the user should not be able to access any previously visited pages using the browser buttons. 
asked
5 answers
1

Hi Himanshi ,

In the azure SSO setting of your app , you will have to give logout uri then session will be killed

image.png

Hope it helps!

answered
1

I would suggest using the browser's Navigate API. You could add a HTML snippet to your page layout with something like this to handle navigation events and signing out a user.

 

navigation.addEventListener("navigate", (event) => {

    //check if user navigates back to login page
    const url = new URL(event.destination.url).toString();
    if (url.includes("/login.html")) {

        // sign out user
        mx.logout();

    };
});

 

answered
0

Hi Himanshi,

If you wanna logout user when user reaches into login.html file then you can go to theme folder and inside login.html file 

inside head tag you can apply script like this for window.location, i have given redirect link for logout in sso based application

and if you are using sso based application , you don't need to disbale back button because after logout ,to access any previous page it will again ask for authentication

image.png

 

Hope it helps!

answered
0

Hi,

This logout URL works for Azure AD based SSO, are you using some other authentication mechanism?

 

answered
0

could you share your application link once

answered