Logout user and redirect them via API

Hi team,

As of now I am using logout API for specific user Id to logout the user from server side.

let userId = "userId_example"; // String | User ID

// Delete all auth tokens for the specified user.
apiInstance.deleteToken(userId)
  .then(() => {
    console.log("deleteToken returned successfully.");
  })
  .catch((err) => {
    console.log("There was a failure calling deleteToken");
    console.error(err);
  });

I am able to log them out successfullt but I want them to be redirected to my application. How can I do this.

If below line the setup for redirecting the user means h0w can I do this from my server.

https://login.mypurecloud.com/logout?client_id=<your client id>&redirect_uri=<a registered redirect for your app>

Thanks,
Magu

Hi Magu,
Assuming this is an HTTP server for the client application, you could implement a server side redirect using a response with 3XX status code and the logout URL in the Location header

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.