Quickstart

Get started with integrating Elixpo Accounts into your application. Register your client, obtain credentials, and implement the authorization flow.

Base URL: https://accounts.elixpo.com

1. Register OAuth Application

Navigate to the Dashboard > OAuth Apps page and click New OAuth App. Provide the following details:

  • Application Name: The user-facing name shown during the consent step.
  • Homepage URL: The primary marketing or landing URL of your app.
  • Redirect URI(s): The absolute callback URLs where users will be redirected upon successful authorization. You can register up to 5 URIs. HTTP and HTTPS are both permitted (useful for local development).

2. Secure Credentials

Upon creation, the system generates a unique Client ID and Client Secret. The client secret is hashed before storage and is displayed only once. Ensure you copy and store it in your server's secure configuration or environment file (e.g. .env).

Node.js Integration Code

Here is a brief server-side implementation example showing how to initialize the auth redirect, handle the callback, exchange code, and fetch user info.

// 1. Generate authorization URL
const state = crypto.randomUUID();
const authUrl = `https://accounts.elixpo.com/oauth/authorize?` +
  `response_type=code&client_id=${CLIENT_ID}` +
  `&redirect_uri=${encodeURIComponent(REDIRECT_URI)}` +
  `&state=${state}&scope=openid profile email`;
// Redirect user to authUrl...

// 2. In your callback handler (e.g. Express)
app.get('/callback', async (req, res) => {
  const { code, state } = req.query;
  // Verify state matches session-stored state...

  // 3. Exchange code for tokens
  const tokenRes = await fetch(
    'https://accounts.elixpo.com/api/auth/token',
    {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        grant_type: 'authorization_code',
        code,
        client_id: CLIENT_ID,
        client_secret: CLIENT_SECRET,
        redirect_uri: REDIRECT_URI,
      }),
    }
  );
  const tokens = await tokenRes.json();

  // 4. Fetch user profile
  const userRes = await fetch(
    'https://accounts.elixpo.com/api/auth/me',
    { headers: { Authorization: `Bearer ${tokens.access_token}` } }
  );
  const user = await userRes.json();
  // user.id, user.email, user.displayName now available!
});