Hello,
All the pages on my power pages are restricted to a specific user, including the home page. I want to direct the user to the sign-in page when they enter the URL https://mywebsite.powerappsportals.com or https://mywebsite.powerappsportals.com/SignIn. I have added this code to the header to redirect them:
Hi @setzav
The answer is already provided by @Fubar. If you are confident with your implementation. All you need is to clear the cache and try again. Link here
Hope it helps.
------------
If you like this post, give it a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users to find it.
I did that but the issue is, that it shows access denied very briefly before showing the login page.
I did that but the issue is, that it shows access denied very briefly before showing the login page. I changed it to make my home available to all users and hide elements based on the user that logs in.
Thanks for the reply!
Have you tried applying permissions to the Home page?
You can do this be creating Web Page Access Control Rule(s) set to "Restrict Read" for the pages that are not anonymous.
https://learn.microsoft.com/en-us/power-pages/security/page-security
In addition, if not using local login and you are using only 1 identity provider (e.g. Azure AD, Azure B2C etc ) you can also set it to the default, and it will push the user straight to the identity provider sign-in (avoids the user having to press the button on the portal sign-in page)