Global SSO Logout
curl --request GET \
--url https://accounts.mubarokah.com/api/logout-sso \
--header 'Authorization: <authorization>'const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://accounts.mubarokah.com/api/logout-sso', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://accounts.mubarokah.com/api/logout-sso"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://accounts.mubarokah.com/api/logout-sso",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://accounts.mubarokah.com/api/logout-sso")
.header("Authorization", "<authorization>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://accounts.mubarokah.com/api/logout-sso"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "<string>"
}OAuth Endpoints
Global SSO Logout
API reference for the Mubarokah ID Global SSO Logout endpoint (/api/logout-sso).
GET
/
api
/
logout-sso
Global SSO Logout
curl --request GET \
--url https://accounts.mubarokah.com/api/logout-sso \
--header 'Authorization: <authorization>'const options = {method: 'GET', headers: {Authorization: '<authorization>'}};
fetch('https://accounts.mubarokah.com/api/logout-sso', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://accounts.mubarokah.com/api/logout-sso"
headers = {"Authorization": "<authorization>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://accounts.mubarokah.com/api/logout-sso",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://accounts.mubarokah.com/api/logout-sso")
.header("Authorization", "<authorization>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://accounts.mubarokah.com/api/logout-sso"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "<string>"
}Global SSO Logout
The Global SSO Logout endpoint allows a client application to terminate the user’s entire Single Sign-On session across the Mubarokah ID ecosystem. Unlike a local logout (which only clears the session in your application), this endpoint:- Revokes the provided Access Token.
- Characteristically terminates the central web session at
mubarokah.id. - Ensures that the user is logged out from all other applications connected via Mubarokah ID SSO.
Authorization
string
required
The Bearer token of the current active session. Example:
Bearer {YOUR_ACCESS_TOKEN}Best Practices & Developer Advice
Single Sign-Out Awareness
Calling this API will log the user out from ALL Mubarokah ID affiliated applications (e.g., Dashboard, other client apps).Recommendation: Before calling this endpoint, show a confirmation dialog to the user:
“Are you sure you want to log out? This will also end your session in other Mubarokah ID applications.”
Calling this API will log the user out from ALL Mubarokah ID affiliated applications (e.g., Dashboard, other client apps).Recommendation: Before calling this endpoint, show a confirmation dialog to the user:
“Are you sure you want to log out? This will also end your session in other Mubarokah ID applications.”
Implementation Tips
- Sequential Logout: First, call this API to terminate the global session. Then, clear your local application session (cookies, localStorage, or server-side session).
- Error Handling: If the API call fails (e.g., due to network issues), you should still proceed with clearing the local session as a fallback.
- Use the SDK: If you are using our React SDK, the
logout()function already handles this logic securely.
Request Examples
JavaScript (fetch)
const globalLogout = async (accessToken) => {
try {
await fetch('https://accounts.mubarokah.com/api/logout-sso', {
method: 'GET',
headers: {
'Authorization': `Bearer ${accessToken}`,
'Accept': 'application/json'
}
});
// Clear local session after global logout success/attempt
localStorage.removeItem('your_app_token');
window.location.href = '/login';
} catch (error) {
console.error('Logout failed:', error);
}
};
Responses
string
Confirmation message of successful logout.
Success Response (200 OK)
{
"message": "Successfully logged out from SSO session"
}
Error Response (401 Unauthorized)
Returned if the token is invalid or already revoked.{
"message": "Unauthenticated."
}
Was this page helpful?