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 / Is there any way to ge...
Power Pages
Unanswered

Is there any way to get currently logged-in User's data in D365 Portal/CRM

(0) ShareShare
ReportReport
Posted on by 29

Hello, 

         we have requirement to process the currently singed in users in portal. ayn idea how to get all the users which are currently logged in? or how to identify if particular contact is currently logged in or not ?

 

thanks! 

 

 

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at

    Hi

    My first guess here would be using the last successful sign-in field from the contact records

     

    • you need to set the Site Settings Authentication/LoginTrackingEnabled to true
    • for every sign-out there is a security stamp that is updated against the Contact record (adx_identity_securitystamp), as far as I remember it doesn't get updated on the login
    • you can create a new field for "last successful logout" and then populate via workflow after the Security Stamp is updated

    This way you would have both sign-in datetime and sign-out datetime.. now you can retrieve logged-in users

    I haven't done this myself, but should work

     

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • justinburch Profile Picture
    Microsoft Employee on at

    Hi @PoojaD,

    As Oliver mentioned, Login Tracking is the simplest approach within CDS, but this field is deprecated (https://docs.microsoft.com/en-us/powerapps/maker/portals/faq#login-tracking-enabled) and not recommended for use - Microsoft's recommendation is to utilize an insights/analytics service. Even still, you will need to define what is considered "currently signed in" - is it someone who last logged in 30 mins or less (using login tracking) or last visited a page 30 seconds or less ago (using insights)?

    What is the purpose of the request?

  • eliz_talent Profile Picture
    98 on at

    You can use {% user.contact %} to get current contact information and onload of the home page call a power automate with pot request, where you will store data about logged in user

  • Pooja Bhagwat Profile Picture
    29 on at

    thanks Justin, basically my requirement to maintain track of contact logged in currently . suppose 5 users are logged in and working on portal, if 6th person comes and try to login to portal, he should able to access features of portal . if one person is logged out from currently 5 , then 6th person can log in. 

     

     

  • Pooja Bhagwat Profile Picture
    29 on at

    @eliz_talent, thanks. Can you please help me with understanding pot request. how to call that from portal page load. 

    thanks in adavance

     

  • justinburch Profile Picture
    Microsoft Employee on at

    Hi @PoojaD,

    Based on your information, I don't suggest using PowerApps Portals. What you are asking will require server-side management that you won't find availability for. Even if you use Oliver's recommendation to identify the number of users currently "logged in", preventing a login (especially dependent on your authentication approach) is going to be a nightmare, if even possible. Multiple concerns for this request:

    1. You will likely need an active pinging process for logged in users that will constantly ping an endpoint you've setup to identify a user is logged in and using the site
    2. What if a user steps away from their browser to respond to an email for 10 minutes - do they get logged out? What about the data they were working with?
    3. Are you expecting a queue process where first come, first serve is honored? Or whoever happens to login at the time the 5th position is relinquished?
    4. How do you setup for error handling in authentication ("sorry, 5 people are already logged in") for a web application you don't have server-side access to?

    Not expecting answers to these, just trying to present concerns I have for the approach. I'd recommend a fully custom application.

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