Legacy Dev Forum Posts

 View Only

Sign Up

Logout user and redirect them via API

  • 1.  Logout user and redirect them via API

    Posted 06-05-2025 19:24

    Magudeeswaran_N | 2023-07-24 21:27:47 UTC | #1

    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


    jacobshaw | 2023-07-25 11:56:03 UTC | #2

    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


    system | 2023-08-25 11:56:29 UTC | #3

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


    This post was migrated from the old Developer Forum.

    ref: 21134