Implementing User Verification
Authentication flow
Setting up user verification
2
Generate an authentication token on your server
{
"account_id": "ACCOUNT_ID",
"user_id": "CURRENT_USER_ID",
"user_email": "CURRENT_USER_EMAIL",
"profile": {
"name": "The display name",
"avatar_url": "https://example.com/avatar.png"
}
}const response = await fetch("https://accounts.releasedhub.com/auth/api/impersonation/token", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer SHARED_SECRET" // Your shared secret
},
body: JSON.stringify({
account_id: "ACCOUNT_ID", // Your Released Account ID
user_id: "CURRENT_USER_ID", // ID of the current authenticated user
user_email: "CURRENT_USER_EMAIL" // Email of the current authenticated user
profile: {
name: "The display name", // The display name of the user
avatar_url: "https://example.com/avatar.png" // The avatar URL of a user profile picture
}
}),
});
const json = await response.json();
console.log(json);Rotating your shared secret
Demo
Need help?
Last updated
Was this helpful?