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 Apps / I want to use Azure AD...
Power Apps
Unanswered

I want to use Azure AD for authenticating users in Power Apps

(1) ShareShare
ReportReport
Posted on by 44
Hi Power Apps Community,
 
Trying to find a way where i can create login screen and authenticate users using Azure AD so that i can show them different UI's based on internal user or external(guest) user. Can anyone help us out in a way we can achieve this?
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,030 Most Valuable Professional on at
    Hi vrush96 
    The built-in functions User().FullName and User().Email identify the logged-in user, so you simply need a reference list setting out what they can/cannot do.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)     Visit my blog Practical Power Apps    Buy me a coffee
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi,
     
    If you want, you can create a Screen, built as a login. Show this screen first to your users. Then, you can create an Environment Variable, that has a comma separate list of all the domains that would identify someone as internal
    Example: Environment Variable called 
    Internal Domains
    Value: me.com,you.com,davis.com,etc.com
     
    Now in your Login Screens OnVisible property you would read this Environment Variable and Split it by the , giving you a Collection with a Value property.
    Or you can instead do a 
    ForAll(Split(MyVariable, ","),
       Collect(MyDomains,
        {
            Domain: ThisRecord
        }  
      )
    );
     
    Now you can take the persons email and split it by the @ sign. Take the [1] index of the returned value so
     
    would turn into
     
    michael <= [0]
    me.com <= [1]
     
    So
    Now we want to check if that user is in our Internal list
     
    If(CountRows(Filter(MyDomains, Domain = Split(User().Email, "@")[1]) > 0, then we know they are internal
         They are internal,
          They are not because there were not items in the collection with their domain
    )
     
    P.S. You could also store the data in a SharePoint config list, or a flat file, whatever you want, I just used an Environment Variable as a sample.
     
    But now you know.
     
     

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard