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 / How to Check Microsoft...
Power Pages
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

 

 

Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    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

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