Skip to main content
Community site session details

Community site session details

Session Id : 6XAJr9F2WoPo3/jhXRdl3V
Power Pages - Power Apps Portals
Unanswered

Portal Enable Login

Like (0) ShareShare
ReportReport
Posted on 30 May 2021 06:09:54 by 68

Hi,

 

I am new to portals. I am trying to setup authentication for portal only for contacts. I have enabled the site settings for authentication but my portal still not prompting for the login instead it directly goes to the home page without requiring for login. The portal is anonymous. How to enable the login authentication? Please help.

 

Thanks.

  • Jayakumar Profile Picture
    68 on 10 Jun 2021 at 05:48:11
    Re: Portal Enable Login

    Thanks for helping.

  • Jayakumar Profile Picture
    68 on 10 Jun 2021 at 05:45:22
    Re: Portal Enable Login

    Thank you Zbird94. Let me try and get back to you of needed. Thanks a lot.

  • Zak Bird Profile Picture
    4 on 08 Jun 2021 at 15:16:15
    Re: Portal Enable Login

    Hi @alwaysjai


    Correct me if I'm interpreting wrongly, but you'd like to force anonymous users to the sign-in page? 

     

    You can create, a Web Page Access Control Rule, and call it e.g. 'Unauthenticated Users restriction'. From there, select Home as the Web Page, the correct Website, and the Right of Restrict Read. Also, the Scope as 'Exclude Direct Child Web Files', this will ensure your CSS still loads on the page. As Home is the main page, all child pages will inherit this Control Rule. This should do the job.

    In addition, to force users not signed in to your sign-in page, you can create a new Web Template e.g. 'Home Redirect' and add this code: 

     

    {% if user %}

    {% else %}

      <script>

        window.location.replace('/SignIn?ReturnUrl=/');

      </script>

    {% endif %}

    Then, save this Web template and include it in your Home Web Template, by adding the line: 

     

    {% include "Home Redirect" %}

     

    A combination of these two suggestions, will effectively bulletproof your portal from anonymous users, I believe. 

     

     

  • Jayakumar Profile Picture
    68 on 02 Jun 2021 at 10:49:30
    Re: Portal Enable Login

    Ok thank you for the reply. I will make this change and try

  • oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 31 May 2021 at 21:03:15
    Re: Portal Enable Login

    see if the above configuration solves the problem, just so we know.. what happens if you force on the browser the portals URL + /SignIn ... does this get redirected to the home page, is that the case?

  • v-bofeng-msft Profile Picture
    on 31 May 2021 at 06:19:01
    Re: Portal Enable Login

    Hi @alwaysjai :
    You can set these web pages' visibility by setting the Permissions property of them.

    v-bofeng-msft_0-1622441855612.png

    I think this link will help you a lot:

    Manage page permissions

    Best Regards,

    Bof

     

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 2

#3
surya narayanan Profile Picture

surya narayanan 35

Loading complete