# Logout API for Cybozu / Kintone

**URL:** <https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036>\
**Category:** General\
**Created:** [June 21, 2024, 3:50am UTC](https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036 "2024-06-21T03:50:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hoang\_Viet](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/hoang_viet/32/618_2.png) [@Hoang\_Viet](https://forum.kintone.dev/u/Hoang_Viet)\
**Post date:** [June 21, 2024, 3:50am UTC](https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036/1 "2024-06-21T03:50:48Z")

</div>

## Question / Problem

I want to call the logout API of the Kintone app from my own app (calling the logout API outside the Kintone app). Is there any way to do this? Thank you very much

---

<div class="post-metadata">

**Author:** ![Chris](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/chris/32/44_2.png) [@Chris](https://forum.kintone.dev/u/Chris)\
**Post date:** [June 21, 2024, 3:47pm UTC](https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036/2 "2024-06-21T15:47:49Z")

</div>

Hello @Hoang_Viet  
I'm not fully sure of your goal, but here's an example of how I did this from the console using an iframe:

```javascript
function kintoneLogout() {
    var logoutUrl = 'https://[your-subdomain].cybozu.com/logout';
    var iframe = document.createElement('iframe');
    iframe.style.display = 'none';
    iframe.src = logoutUrl;

    iframe.onload = function() {
        console.log('Logged out successfully');
        setTimeout(() => {
            window.location.href = 'https://[your-subdomain].cybozu.com';
        }, 1000); // Optional timeout before redirect
    };

    iframe.onerror = function() {
        console.error('Logout failed');
    };

    document.body.appendChild(iframe);
}

// Call the logout function
kintoneLogout();

```

---

<div class="post-metadata">

**Author:** ![Hoang\_Viet](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/hoang_viet/32/618_2.png) [@Hoang\_Viet](https://forum.kintone.dev/u/Hoang_Viet)\
**Post date:** [June 24, 2024, 4:16am UTC](https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036/3 "2024-06-24T04:16:45Z")

</div>

We enable SAML authentication and configure cybozu to call our IDP server. We want to be able to manage each user's login\_histories and be able to logout users through our portal page.  
Please help me, thank you

---

<div class="post-metadata">

**Author:** ![Chris](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/chris/32/44_2.png) [@Chris](https://forum.kintone.dev/u/Chris)\
**Post date:** [June 24, 2024, 4:59pm UTC](https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036/4 "2024-06-24T16:59:38Z")

</div>

Hello @Hoang_Viet  
Kintone does not offer a specific API for directly accessing audit logs or user login histories. You can view user login histories through [the audit log feature](https://get.kintone.help/general/en/id/02086.html) in the Kintone admin settings, but this data cannot be retrieved programmatically via the Kintone API.

For tracking and managing login histories, especially with SAML authentication, you should rely on your Identity Provider (IDP). Most IDPs provide audit logs and APIs to monitor user authentication events.

To log out users from Kintone using your IDP, utilize the Single Logout (SLO) functionality typically offered by IDPs. SLO enables simultaneous logout from multiple applications, including Kintone, triggered by a logout request from the IDP. Implementing SLO and configuring a custom logout handler on your portal page ensures effective management of user logouts.

---

<div class="post-metadata">

**Author:** ![Chris](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.kintone.dev/chris/32/44_2.png) [@Chris](https://forum.kintone.dev/u/Chris)\
**Post date:** [June 26, 2024, 4:55pm UTC](https://forum.kintone.dev/t/logout-api-for-cybozu-kintone/1036/5 "2024-06-26T16:55:39Z")

</div>

After further investigation, Kintone does not currently support Single Logout (SLO) as part of its SAML authentication implementation. This means there isn't a specific logout URL in Kintone to handle logout requests from the Identity Provider (IDP). As Kintone also lacks a logout API, you would need to use your IDP's logout URL to log out the user from the IDP session.
