
Azure Static Web Apps: Simple Logout Without login_hint
Azure Static Web Apps: Simple Logout Without login_hint In my previous posts I covered how to pass login_hint to EasyAuth for a smoother sign-in experience. But there's a simpler approach to the logout/login flow that avoids login_hint entirely and is more user-friendly. The problem with default EasyAuth logout When you redirect a user to /.auth/logout , EasyAuth signs them out on the Azure AD server. This kills not just their SWA session but every active SSO session tied to that account - Azure Portal, Outlook, Teams, any other app using the same identity. For an internal app where users are signed into a dozen Microsoft services, that's a bad experience. A better approach: sign out of SWA only Instead of a full server-side logout, we can clear the EasyAuth session on the SWA while keeping the Azure AD session alive. The user gets signed out of our app but stays signed into everything else. The trick is to call the logout endpoints with fetch instead of a redirect: fetch to /.auth/log
Continue reading on Dev.to
Opens in a new tab

