Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  Logout user through API

    Posted 06-05-2025 18:10

    mvishwanath | 2016-09-30 08:29:38 UTC | #1

    I am using the following code to logout user.

    TokensApi tokensApi = new TokensApi(apiClient); String result = tokensApi.deleteMe();

    after logout, I am redirecting user to login page(https://login.mypurecloud.com), where in user gets logged-in automatically.

    I want the user to login again after logout. Its not happening unless user clears the cache of purecloud.


    chuck.pulfer | 2016-09-30 13:11:03 UTC | #2

    See: https://developer.mypurecloud.com/api/rest/authorization/

    The preferred way to log out is to redirect the user to https://login.mypurecloud.com/logout. This will destroy any tokens associated with the session cookie, but will not destroy sessions from other sessions/applications. After redirecting the user to the page, they will be prompted to enter their credentials the next time an OAuth flow is started.


    lasator | 2016-09-30 17:15:23 UTC | #3

    Is there a way to do this safely only using the API? My application isn't web-based and does not track any session cookies.


    KevinGlinski | 2016-09-30 17:44:21 UTC | #4

    The session cookie Chuck is referring to is from login.mypurecloud.com and is our cookie. We use it so that if you log in multiple times during a short amount of time you don't need to re-enter your credentials.


    system | 2017-08-28 19:27:40 UTC | #5


    This post was migrated from the old Developer Forum.

    ref: 457