Skip to main content
Community site session details

Community site session details

Session Id :
Power Pages - Power Apps Portals
Unanswered

How to Check Microsoft User(SSO) is already logged-in

(0) ShareShare
ReportReport
Posted on by 1,510

Hi,

 

I have two sign-in buttons in PowerApps Portals:

1. External Login = Azure AD B2C

2. Internal User (SSO) = Azure AD

 

Now, I want to hide show based on condition, In browser, if microsoft user is already logged-in, If yes, then I want to hide "External Login" button and display only "Internal User (SSO)" button. If not, then "Internal User (SSO)" button should hide and show "External Login" button. Is there any work around for this issue?

 

hardikv_0-1643167421468.png

 

 

  • Christian Leverenz Profile Picture
    1,214 on at
    Re: How to Check Microsoft User(SSO) is already logged-in

    Hi @hardikv ,

     

    just an idea: if you call the loginpage in an iframe, you could may be press the ad button by a script and check, whether login succeeds. If yes, the user is logged in. As far as i know, for the loginwindow no popup will appear as the id-providers usually do not allow to do so.

    If the login is successful, it will answer fast. If it fails, you would have to use some sort of timeouting which is always dangerous.

     

    Oh, may be the msal library could be used to check that out. May be you could try to renew the token and check, whether its an AD token. But I did not check on that one. May be it helps:  https://docs.microsoft.com/en-us/azure/active-directory/develop/msal-migration 

     

    Christian

     

    PS i really like the idea to check, whether there is an ad user available in order not to confuse the user with the choice.

     

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

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!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 1

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 1

#3
surya narayanan Profile Picture

surya narayanan 35