Hi @Roel Camp we're sorry to hear you're facing this issue.
Based on the code snippet you provided, it looks like you are using the Microsoft Authentication Library (MSAL) for Angular to implement logout redirect feature in your Angular app, but the redirect is not working as expected.
Yes, this could be because you're using a VM. Can you please share the Azure doc you followed to set up your logout redirect feature? In the meantime, here are a few things you can do to troubleshoot the issue:
- Check if the
postLogoutRedirectUri
parameter is set correctly in your Azure AD app registration. You can do this by navigating to your app registration in the Azure portal, selecting "Authentication" from the left-hand menu, and verifying that the "Logout URL" field is set to "[http://localhost:4200]".The redirectUri needs to match exactly between your Azure AD app registration and MSAL configuration. Make sure "[http://localhost:4200] is configured in both places. - On a VM, localhost refers to the VM itself, not your host machine. Update the redirect URI to use the actual VM IP address or hostname instead.
- The redirectURI in MSAL also needs to be publicly reachable by Azure AD, so localhost on a VM will not work. Configure your VM to expose port 4200 publicly and use that URL.
Please let us know if you have further questions.
-Grace