{"__v":5,"_id":"54011f0ec1c1764f69827203","category":{"__v":6,"_id":"53fe7d89addab8973c1af2b0","pages":["53fe7e17addab8973c1af2bb","53fe80ebaddab8973c1af2be","54011f0ec1c1764f69827203","53fe8159addab8973c1af2c1","53fe81ecaddab8973c1af2c5","54d94b3c6a09052100a6b699","56d49a9da4a9211b00c8f118"],"project":"53fe6dc5addab8973c1af267","version":"53fe6dc5addab8973c1af26a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-08-28T00:53:29.717Z","from_sync":false,"order":6,"slug":"logout-reference","title":"Logout Reference"},"is_link":false,"parentDoc":null,"project":"53fe6dc5addab8973c1af267","user":"53fe70beaddab8973c1af273","version":{"__v":19,"_id":"53fe6dc5addab8973c1af26a","project":"53fe6dc5addab8973c1af267","createdAt":"2014-08-27T23:46:13.941Z","releaseDate":"2014-08-27T23:46:13.941Z","categories":["53fe6dc5addab8973c1af26b","53fe71a2addab8973c1af276","53fe7d89addab8973c1af2b0","53fe7d8daddab8973c1af2b1","53fe836faddab8973c1af2ce","53ff9a4823a37e1d5cebafe1","53ff9e3723a37e1d5cebaff7","53ffaca523a37e1d5cebb039","53ffad2e23a37e1d5cebb03c","5400c7d2ec93b29b61d4f7be","5400f0e1ec93b29b61d4f7dd","54d5636323010a0d001aca81","54d565c1276f8e0d00feab54","54ff40532882a10d00546927","556606d25561af0d008208b7","558c91900b236c2500d37c9a","56180a14f8c9632100ac7599","564fb3a59b4fab1700187518","5702e2d2f2d6f336005e901f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["57cecd5f07d7ea0e00e438c2"],"next":{"pages":[],"description":""},"createdAt":"2014-08-30T00:47:10.480Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":2,"body":"You'll often want to test your logout hook locally to make sure it works before pushing your code to production. With a web-accessible domain, Clef's server can trigger your logout hook on its own, but if you're developing on localhost, we won't be able to reach your server. \n\nLuckily, we've provided some simple tools to help you test your logout hook.\n\nTo use them, check out one of [your Clef integrations](https://getclef.com/team/applications) and click the \"Testing\" tab. You'll want to **log in with Clef to your site** before triggering a test logout hook.\n\nAs the person who generated the App ID and App Secret, **you'll be logged out when you trigger a test logout hook** with either method below. If you decide to push your code to production, don't share the test logout token with anyone since they'll be able to log you out by triggering your logout hook URL with it. You can always clear or generate a new test logout token. \n\n# Triggering logout for web-accessible domains\n\nThe easiest way to trigger logout hooks for web-accessible domains is by using the web tool in the \"Testing\" tab. If you've already set your logout hook, just click \"Trigger Logout Hook\". Our server will hit your logout hook URL and you'll see the result of the request on the page.\n\n# Triggering logout for localhost\n\nSince our server can't access a URL being served from localhost, the easiest way to trigger a logout hook for localhost is by using cURL from a shell on the same computer. To do this, generate a test logout token from the \"Testing\" tab. You'll then want to run the cURL command you see on the page in a shell.","excerpt":"If you want to test logout hooks locally, we have some simple tools you can use.","slug":"testing-logout-hooks","type":"basic","title":"Testing logout hooks"}

Testing logout hooks

If you want to test logout hooks locally, we have some simple tools you can use.

You'll often want to test your logout hook locally to make sure it works before pushing your code to production. With a web-accessible domain, Clef's server can trigger your logout hook on its own, but if you're developing on localhost, we won't be able to reach your server. Luckily, we've provided some simple tools to help you test your logout hook. To use them, check out one of [your Clef integrations](https://getclef.com/team/applications) and click the "Testing" tab. You'll want to **log in with Clef to your site** before triggering a test logout hook. As the person who generated the App ID and App Secret, **you'll be logged out when you trigger a test logout hook** with either method below. If you decide to push your code to production, don't share the test logout token with anyone since they'll be able to log you out by triggering your logout hook URL with it. You can always clear or generate a new test logout token. # Triggering logout for web-accessible domains The easiest way to trigger logout hooks for web-accessible domains is by using the web tool in the "Testing" tab. If you've already set your logout hook, just click "Trigger Logout Hook". Our server will hit your logout hook URL and you'll see the result of the request on the page. # Triggering logout for localhost Since our server can't access a URL being served from localhost, the easiest way to trigger a logout hook for localhost is by using cURL from a shell on the same computer. To do this, generate a test logout token from the "Testing" tab. You'll then want to run the cURL command you see on the page in a shell.