web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Sign in page as the la...
Power Pages
Unanswered

Sign in page as the landing page

(1) ShareShare
ReportReport
Posted on by

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:

 

{% if user %}
Hello, {{ user.fullname }}!
{% else %}
<script type="text/javascript">
if (window.location.pathname != "/SignIn") {
window.location.assign("/SignIn?ReturnUrl=%2F");
}
</script>
{% endif %}
 
however, it always shows the access denied page and then the sign-in page, which looks very unprofessional. I want it to just land on the sign-in page first. Can anyone explain why?
 
Thank you in advance!
Categories:
I have the same question (0)
  • Fubar Profile Picture
    8,338 Super User 2025 Season 2 on at

    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-platform/admin/powerapps-flow-licensing-faq#access-to-my-website-is-authenticated-however-it-has-an-anonymous-log-in-page-do-i-need-to-purchase-an-anonymous-user-subscription

    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)

    https://learn.microsoft.com/en-us/power-pages/security/authentication/configure-site#set-a-default-identity-provider

  • poweruser38 Profile Picture
    4 on at

    Have you tried applying permissions to the Home page?

  • setzav Profile Picture
    on at

    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!

  • setzav Profile Picture
    on at

    I did that but the issue is, that it shows access denied very briefly before showing the login page. 

  • ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard