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?
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.
Lucas001
60
Super User 2025 Season 1
Fubar
55
Super User 2025 Season 1
surya narayanan
35