# Last login date for separate applications in tenant

**URL:** <https://community.auth0.com/t/last-login-date-for-separate-applications-in-tenant/92224>\
**Category:** Get Help\
**Tags:** redirect, login, auth0\
**Created:** [October 12, 2022, 10:29am UTC](https://community.auth0.com/t/last-login-date-for-separate-applications-in-tenant/92224 "2022-10-12T10:29:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rga](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rga/32/39436_2.png) [@rga](https://community.auth0.com/u/rga)\
**Post date:** [October 12, 2022, 10:29am UTC](https://community.auth0.com/t/last-login-date-for-separate-applications-in-tenant/92224/1 "2022-10-12T10:29:12Z")

</div>

Hi,  
I am implementing a system with several applications attached to one tenant.

I have SSO, Universal Login and all applications with working authorization and authentication using Auth0.  
What I want to do is to implement lastLoggedIn date for all applications separately.  
For example: ApplicationA, ApplicationB and ApplicationC is given. I want to use the same SSO for all of these apps with same credentials, and I want to store lastLoggedIn date for each apps (for example: 11/11/2022 (for app A) 13/11/2022 (for app B) and 9/9/2022 (for app C)).  
I understand that `last_login` field point date of last logging to Auth0 - such as Universal Login and it is shared across applications.

Is there any possibility to obtain that data from Auth0 user, either from API or callback redirect?  
Can it be done by checking what app want to authorize in Auth0 or it have to be done separately from Auth0?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 13, 2022, 7:33pm UTC](https://community.auth0.com/t/last-login-date-for-separate-applications-in-tenant/92224/3 "2022-10-13T19:33:32Z")

</div>

Hi @rga,

Welcome to the Auth0 Community!

> [@rga](#):
>
> Is there any possibility to obtain that data from Auth0 user, either from API or callback redirect?  
> Can it be done by checking what app want to authorize in Auth0 or it have to be done separately from Auth0?

Unfortunately, it is not possible to get a user’s last login date for separate applications.

As a workaround, I recommend creating a [Post Login Action](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow) script where you save the `last_login` property based on the application they are logging into in the `user_metadata`.

To do so, you will need to [call the Management API in Actions](https://community.auth0.com/t/how-can-i-use-the-management-api-in-actions/64947) to get the `last_login` property and then call the `api.user.setUserMetadata` method to save this value.

For example:

```auto
api.user.setUserMetadata(event.client.name, last_login)

```

This way, you can save the last login date for each separate application and query it in the future by checking the user\_metadata.

I hope this helps!

Please let me know if you need any help with implementation or need further clarification.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [October 27, 2022, 7:34pm UTC](https://community.auth0.com/t/last-login-date-for-separate-applications-in-tenant/92224/4 "2022-10-27T19:34:16Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
