web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / I want to use Azure AD...
Power Apps
Suggested Answer

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

(1) ShareShare
ReportReport
Posted on by 46
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
    154,797 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,969 Moderator 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 505

#2
WarrenBelz Profile Picture

WarrenBelz 502 Most Valuable Professional

#3
Haque Profile Picture

Haque 324

Last 30 days Overall leaderboard