Forum Discussion

sirfan1's avatar
sirfan1
Contributor
8 years ago

Logout Api not changing the online_status of the user

Hi All ,

 

I am trying to logout using API , here is the steps 

1. First I get the admin session key by executing , 

http://community-name/restapi/vc/authentication/sessions/login?user.login={username}&user.password={password}

Result : sessionkey

 

2. This will give me the session key , which i am using to login another user as below ,

http://community-name/restapi/vc/authentication/sessions/login?restapi.session_key={sessionkey}&user.login={username}

 

Result : This will change the online_status = "online"

( select * from users where id = '12' ) do this in API Browser.

 

3. After that i am logging out using following api ,

http://community-name/restapi/vc/authentication/sessions/logout?restapi.session_key={sessionkey}&user.login={username}

 

Result : Success 

 

But when i check the online_status its still online . 

 

Can you please guide me how i can kill the session / or the online_status will only change after 30 minuets as the default session key is preserved for 30 min .

 

Regards

Irfan

1 Reply

  • DougS's avatar
    DougS
    Khoros Oracle
    8 years ago

    The REST API session key is not the same as the web ui session, so logging it out will invalidate the REST API session, but will not affect the web ui session, so if you are signed in via the web ui, you will still appear online. Authenticating or logging out via REST V1 should  have no effect on your online status.

     

    To sign out of the web ui, you can hit the signout URL in the community.

     

    If you are using Lithium SSO, we also provide a way to sign a user out using an SSO token that sets a special SSO id ($LiAnonPlz$) that represents the anonymous user (in the java SSO client, use the LithiumSSOClient.ANONYMOUS_UNIQUE_ID field, for .Net use the SSOClient.ANONYMOUS_UNIQUE_ID field, for PHP use the $lithiumSSOClient->ANONYMOUS_UNIQUE_ID field). See the SSO Client guide (attached to the page and called something like LithiumSSO_Guide_15_12.pdf -- version may have changed from this) for a code example.

     

    -Doug