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 / Check that logged on u...
Power Apps
Suggested Answer

Check that logged on user is same as PowerApps logged on user?

(1) ShareShare
ReportReport
Posted on by 2
Hi,
 
I wonder if anyone can help.
 
  • We have a powerapp that has a SharePoint backend.
  • We use the logged on user from office 365 and when opening the power app it's seamless. (user has access to the SharePoint backend and the powerapp)
  • We are relying on users logging off shared machines and logging back on.
  • We have a case, where a user did not log off, and another user went to Outlook and signed out and signed back in with her own office 365 ID
  • Issue: The PowerApp was still using the previous user credentials (so new user coudl see previous user data in power app)
Clearly, the user did not restart the machine and is in breach of company policy.
 
Is there anyway we can detect if this happens again that the power app automatically signs out?
 
Also, is there a way to sign out of power app without signing off office 365 in full? So are Apple just contain an exit button that signs out and closes the app not outlook or anything else?
 
 
Thanks
 
Any help reallly appreicted
 
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,976 Moderator on at
    Hi,
     
    So not really on the app runs as person A and the rest runs as person B, I mean it IS possible, but it requires that people are using Incognito browsers etc etc
     
    As for signing them out.
     
    I am not sure how or if this would work for sure.
     
    1. Add a Timer to your Main Screen
    2. in the App OnStart add a variable Set(_currentUser, User().Email);
     
     
        You can't really close the app, but you would have to make it so that your APP, has the ability to wipe the data and screens clean in the Timer, and only display a message that says Close and Re-open app or something easier do the below
     
    1. Add a Square (rectangle share) that covers the Screen fully of your app
    1a. After adding it, select it in the left screen navigation. Click ... and say bring to Front, so its on top of everything.
     
    2. Make it Black or Dark Grey something
    3. Make it invisible with a variable _isVisible
    3a. in the OnVisible of the screen put 
    Set(_isVisible, false);
     
    3b. in the Shapres visible property put _isVisible
     
    4. In the Timer, have it fire off....  like every XX seconds.
    In the timer check
     
    If(_currentUser <> User().Email,
    Set(_isVisible, true);
    );
     
    Now you have blanked out the app so they cannot see data.
    you can also add a Text Label on top of the Shape with a message to restart the app.
    You could Group them together and set the visible property of hte Group to _isVisible.
     
     
     

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
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard