# Session maintenance at Auth0

**URL:** <https://community.auth0.com/t/session-maintenance-at-auth0/9009>\
**Category:** Get Help\
**Tags:** token, java, logout\
**Created:** [December 18, 2017, 3:32pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009 "2017-12-18T15:32:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![priya.sharma.9362](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/priya.sharma.9362/32/14302_2.png) [@priya.sharma.9362](https://community.auth0.com/u/priya.sharma.9362)\
**Post date:** [December 18, 2017, 3:32pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/1 "2017-12-18T15:32:48Z")

</div>

I am working with the JAVA SDK for triggering login and other operations.

I would like to know whether every new login request triggers the creation of a new session at Auth0 or it just picks something from the existing session (if it isn’t expired yet).

That would help me clear my mind on whether or not log out from Auth0 is required or just clearing the session locally would work.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 18, 2017, 6:58pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/2 "2017-12-18T18:58:16Z")

</div>

I confess that within our SDK’s the Java one is not the one that I’m most familiar with, but as is the case with others the SDK may allow for different authentication flows so the definitive answer to your question requires additional information in order to know which authentication flow you’re using.

For example, if you’re using the resource owner password credentials grant then this flow does not create a session at the identity provider (in this case the Auth0 service). However, if you’re using the authorization code grant which redirects the end-user to the authorization endpoint where they will complete authentication/authorization then a session would be created in the service.

---

<div class="post-metadata">

**Author:** ![priya.sharma.9362](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/priya.sharma.9362/32/14302_2.png) [@priya.sharma.9362](https://community.auth0.com/u/priya.sharma.9362)\
**Post date:** [December 18, 2017, 9:12pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/3 "2017-12-18T21:12:03Z")

</div>

Thanks for the reply @jmangelo  
I am using → Log In with Password Realm - /oauth/token  
[https://github.com/auth0/auth0-java](https://github.com/auth0/auth0-java)

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [December 19, 2017, 10:34pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/4 "2017-12-19T22:34:47Z")

</div>

The resource owner password credentials grant does not trigger a session to be established at Auth0 service.

---

<div class="post-metadata">

**Author:** ![priya.sharma.9362](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/priya.sharma.9362/32/14302_2.png) [@priya.sharma.9362](https://community.auth0.com/u/priya.sharma.9362)\
**Post date:** [January 18, 2018, 12:39pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/5 "2018-01-18T12:39:29Z")

</div>

Hi @jmangelo

I need another help in continuation of this.

Now that we are implementing social login using the /authorize endpoint, I think we will have to log out the user from the identity provider as well, by keeping the federated flag true for the /logout endpoint.

Just need your confirmation, if I am thinking in the right direction. or there is something else that I need to think about.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![priya.sharma.9362](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/priya.sharma.9362/32/14302_2.png) [@priya.sharma.9362](https://community.auth0.com/u/priya.sharma.9362)\
**Post date:** [January 18, 2018, 12:39pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/6 "2018-01-18T12:39:29Z")

</div>

Hi @jmangelo

I need another help in continuation of this.

Now that we are implementing social login using the /authorize endpoint, I think we will have to log out the user from the identity provider as well, by keeping the federated flag true for the /logout endpoint.

Just need your confirmation, if I am thinking in the right direction. or there is something else that I need to think about.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [January 22, 2018, 11:27pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/7 "2018-01-22T23:27:51Z")

</div>

Yes, the `federated` option would be the way to trigger the logout also in the upstream identity provider. Just have in mind that this requires that upstream identity provider to honor that logout request and some may also have different requirements. See the docs at ([https://auth0.com/docs/logout](https://auth0.com/docs/logout)) which mention supported providers and other specifics.

---

<div class="post-metadata">

**Author:** ![priya.sharma.9362](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/priya.sharma.9362/32/14302_2.png) [@priya.sharma.9362](https://community.auth0.com/u/priya.sharma.9362)\
**Post date:** [January 31, 2018, 4:17pm UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/8 "2018-01-31T16:17:26Z")

</div>

Hey @jmangelo,  
Does the login using social identity provider as per the above discussion, trigger a session establishment at Auth0?

---

<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:** [March 2, 2018, 5:57am UTC](https://community.auth0.com/t/session-maintenance-at-auth0/9009/9 "2018-03-02T05:57:51Z")

</div>


