cancel
Showing results for 
Search instead for 
Did you mean: 

Validate user before accounts.logout in SAP Customer Data Cloud

jainamsheth
Employee
Employee

For Logging out a user I am using accounts.logout API (SAP CDC Logout API) and passing the UID of the user in the params. Before logging out I need to validate the user session if it is valid or not. Are there any ways to validate the session before logging out?

I tried using the accounts.session.verify API SAP CDC session verify API by passing the sessionInfo.cookieValue (obtained from user login response) into the oauth_token param of the verify API. But the api returns the following even when I am sending the necessary headers like apiKey, userKey, secret and grant_type

{ "callId": "97aa1107fed247b3aa22c9a07218befd", "errorCode": 403007, "errorDetails": "Invalid namespace 'accounts.session' or method 'verify' or you do not have the required permissions to call it. ", "errorMessage": "Permission denied", "apiVersion": 2, "statusCode": 403, "statusReason": "Forbidden", "time": "2023-10-17T19:15:49.763Z" }

Is there any way I can fix this or any other correct way of validating the session of the logged in User?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

SebastianSchuck
Active Participant
0 Kudos

Hey,

just to clarify, we are talking about a backend scenario, right? Because if so, all API endpoints, I know of, require an access token of the user to verify the user's session.

jainamsheth
Employee
Employee
0 Kudos

Got it. Currently the access token implementation is not in place and hence this issue.

Thanks for the response.

Answers (0)