Identité numérique unifiée
Un seul compte.
Connectez-vous partout.
Utilisé par
██████╗ █████╗ ███╗ ██╗██████╗ ██╗ ██╗ ██╔════╝██╔══██╗████╗ ██║██╔══██╗╚██╗ ██╔╝ ██║ ███████║██╔██╗ ██║██║ ██║ ╚████╔╝ ╚██████╗██║ ██║██║ ╚████║██████╔╝ ██║ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═╝
Connectez-vous pour accéder à votre espace CandyLog.
Gérez votre compte CandyLog
Accédez au panel développeur et créez des applications CandyLog.
Déconnectez-vous de votre session CandyLog.
Supprimez l'accès de toutes les applications tierces.
Intégrez CandyLog dans vos applications
Copiez le code complet ci-dessous dans un fichier index.html — c'est prêt à tester.
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Mon app avec CandyLog</title>
<style>
body { font-family: -apple-system, sans-serif; display: flex;
align-items: center; justify-content: center;
min-height: 100vh; margin: 0; background: #f5f5f7; }
.box { background: #fff; border-radius: 16px; padding: 40px;
text-align: center; box-shadow: 0 4px 24px rgba(0,0,0,.08);
max-width: 360px; width: 100%; }
h1 { font-size: 1.4rem; margin-bottom: 8px; }
p { color: #86868b; font-size: .9rem; margin-bottom: 28px; }
.user-card { display: none; text-align: left; background: #f5f5f7;
border-radius: 12px; padding: 16px; margin-top: 20px; }
.user-card img { width: 48px; height: 48px; border-radius: 50%;
object-fit: cover; margin-right: 12px; vertical-align: middle; }
.user-name { font-weight: 600; font-size: 1rem; }
.user-id { font-size: .75rem; color: #86868b; font-family: monospace; }
.logout-btn { margin-top: 16px; padding: 8px 18px; border-radius: 980px;
border: 1px solid #d2d2d7; background: transparent;
cursor: pointer; font-size: .85rem; color: #1d1d1f; }
.logout-btn:hover { background: #f5f5f7; }
</style>
</head>
<body>
<div class="box">
<h1>Mon Application</h1>
<p>Connectez-vous pour continuer</p>
<!-- Le bouton CandyLog -->
<button
data-candylog
data-client-id="VOTRE_CLIENT_ID"
data-redirect-uri="http://localhost:5500/index.html">
</button>
<!-- Carte utilisateur (affichée après connexion) -->
<div class="user-card" id="user-card">
<div style="display:flex;align-items:center;margin-bottom:10px;">
<img id="user-avatar" src="" alt="">
<div>
<div class="user-name" id="user-name"></div>
<div class="user-id" id="user-id"></div>
</div>
</div>
<button class="logout-btn" onclick="logout()">Se déconnecter</button>
</div>
</div>
<!-- SDK CandyLog (charge et style le bouton automatiquement) -->
<script src="https://candylog.candygate.eu/sdk.js"></script>
<script>
const ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImVra3ZkZGdwdm9kbHBicml1eG9pIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzQxNzQ0NzQsImV4cCI6MjA4OTc1MDQ3NH0.KXpIx4zjmxaqTrLsIoxes-nTU8YkwJx9UJAz_QkrFG0';
// Vérifie si on revient d'un login CandyLog
const params = new URLSearchParams(window.location.search);
const token = params.get('access_token');
if (token) {
// Nettoie l'URL
history.replaceState({}, '', window.location.pathname);
// Récupère les infos utilisateur
fetchUser(token);
}
async function fetchUser(token) {
const res = await fetch(
'https://ekkvddgpvodlpbriuxoi.supabase.co/rest/v1/rpc/candylog_get_user',
{
method: 'POST',
headers: { 'Content-Type': 'application/json', 'apikey': ANON_KEY },
body: JSON.stringify({ p_token: token })
}
);
const user = await res.json();
if (user.error) {
alert('Erreur : ' + user.message);
return;
}
// Sauvegarde en session
sessionStorage.setItem('candylog_token', token);
sessionStorage.setItem('candylog_user', JSON.stringify(user));
showUser(user);
}
function showUser(user) {
document.querySelector('[data-candylog]').style.display = 'none';
document.querySelector('p').style.display = 'none';
const card = document.getElementById('user-card');
document.getElementById('user-avatar').src = user.avatar_url || '';
document.getElementById('user-name').textContent = user.display_name || user.username;
document.getElementById('user-id').textContent = 'ID : ' + user.id.slice(0, 8) + '...';
card.style.display = 'block';
}
function logout() {
sessionStorage.removeItem('candylog_token');
sessionStorage.removeItem('candylog_user');
location.reload();
}
// Restaure la session si déjà connecté
const saved = sessionStorage.getItem('candylog_user');
if (saved) showUser(JSON.parse(saved));
</script>
</body>
</html>
redirect_uri = http://localhost:5500/index.htmlVOTRE_CLIENT_ID par le client_id généréBase URL : https://ekkvddgpvodlpbriuxoi.supabase.co
/rest/v1/rpc/candylog_get_user
Récupère le profil utilisateur associé à un access_token.
{ "p_token": "ACCESS_TOKEN_ICI" }
{
"id": "uuid",
"username": "jean_d",
"display_name": "Jean Dupont",
"avatar_url": "https://...",
"scopes": ["profile"],
"expires_at": "2026-06-07T..."
}
/rest/v1/rpc/candylog_get_app
Vérifie qu'un client_id est valide et récupère les infos publiques de l'app.
{ "p_client_id": "CLIENT_ID_ICI" }
/authorize
Redirige l'utilisateur vers la page de consentement CandyLog.
client_id=VOTRE_CLIENT_ID redirect_uri=https://votre-site.com/callback state=VALEUR_ALEATOIRE_CSRF (optionnel) scope=profile (optionnel)