cancel
Showing results for 
Search instead for 
Did you mean: 

Logout not working (SAP Cloud Platform SDK for Android)

03-25-2019 12:36 PM
1418 views 6 comments
0 Likes
SAP Managed Tags
Subscribe

Hi Team,

I am unable to registered/remove ID from HCPMS trial account. I registered device using saml based authentication.

I am using (SAP Cloud Platform SDK for Android) Version 2.0 and I am using below code snippet. Please help me.

public void unRegisterLogic() {
String serviceUrl = "https://hcpms-xxxxxxxxtrial.hanatrial.ondemand.com";
try {
CookieManager.getInstance().removeAllCookies(null);
} catch (Exception e) {
e.printStackTrace();
}
Request request = new Request.Builder()
.post(RequestBody.create(null, ""))
.url(serviceUrl + "/mobileservices/sessions/logout")
.build();

Callback updateUICallback = new Callback() {
@Overridepublic void onFailure(@NonNull Call call, final IOException e) {
Log.d("APP", "Log out failed: " + e.getLocalizedMessage());
}

@Overridepublic void onResponse(@NonNull Call call, final Response response) {
if (response.isSuccessful()) {
Log.d("APP", "Successfully logged out");
} else {
Log.d("APP", "Log out failed " + response.networkResponse());
}
}
};
ClientProvider.get().newCall(request).enqueue(updateUICallback);
}

Regards

Ramakrishna.Amathi

0 Likes

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Likes

Hi Dan,

User logout request working fine. It showing message like "User session 894AE285CE80649B3857F6BA2DC59A35A9F292B2BBE3CF1539003205026DAABA successfully terminated" HCPMS logs. But If i use same appcid in rest client/Postman data getting success. Any thing wrong is there in my side.

Regards

Ramakrishna. Amathi

Former Member
0 Likes

Ok Dan, Let me try once and then update you.

Regards

Ramakrishna. Amathi

Dan_vL
Product and Topic Expert
Product and Topic Expert
0 Likes

I believe the link Rob was trying to share is

Delete Application Connection

The user logout request I believe stops the session between the client and the server rather than removing the ID from Mobile Services.

If the goal is to periodically clean up unused registrations, one other approach to this would be to use the Automatic Removal feature under the user registrations tab.
https://help.sap.com/viewer/38dbd9fbb49240f3b4d954e92335e670/Cloud/en-US/35877fbd394344c7885d0f15f9c...

Hope that helps,
Dan van Leeuwen

Former Member
0 Likes

Hi Team,

Please update above comment. I registered device using basic and saml based authentication.

Regards

Ramakrishna. Amathi

Former Member
0 Likes

Hi Rob,

I tired above link but i am getting forbidden error.I registered device based on SAML based authentication.

In HCPMS log getting message "Login with authentication type FORM failed"

Regards

Ramakrishna. Amathi

Former Member
0 Likes