cancel
Showing results for 
Search instead for 
Did you mean: 

Android BTP SDK - How to logout for a user?

Fish
Discoverer
0 Kudos

Hello,

As I tried the way mentioned in the document. But it is not effective as expected, is it still accessible by logging out with certain request?

And I tried to get the same cookieJar with the ClientProvider.

val request = Request.Builder()
    .post("".toRequestBody(null))
    .url(hostUrl + "/mobileservices/sessions/logout")
    .build()
CookieManager.getInstance().removeAllCookies(null);
ClientProvider.get().newCall(request).enqueue(object : Callback {...}

Accepted Solutions (0)

Answers (1)

Answers (1)

jameszhangyn
Advisor
Advisor

As discussed with Elina offline via Team, i have explained the current behavior for OAuth authentication. All client request will bring the access_token which is stored in client secure storage. Even the current session is invalidated by calling Logout API, the next request from client will still be able to establish a new session. So for OAuth type, the user still can use the client app without sessing any login screen is the correct behavior. But for SAML type, after Logout API is called, the user should see a login form again.