Skip to main content

Create a custom Astrato Login page for your portal

Create a custom login page for Astrato using the OEM API Web Ticket authentication flow.

Piers Batchelor avatar
Written by Piers Batchelor
Updated yesterday

Requirements

  • Host the login page

  • Manage username/password authentication in your portal

Preparation

ℹ️ User validation is required on customer portal side. New identities will become new users.

Navigate to https://app.astrato.io/administration/system-settings/general and copy the credentials for the OEM Management API. These include a key and secret.

Custom login page example file

AI Prompt - to generate your custom login page

Goal: Create a custom login page for Astrato using the OEM API Web Ticket authentication flow.

Tech Stack:

  • Backend: Python (Flask)

  • Frontend: Vanilla HTML/JS

Requirements:

  1. Backend Implementation (

    server.py):

    • Create a Flask server with a POST /api/login endpoint.

    • The endpoint should accept an email in the request body.

    • It must perform two API calls to Astrato:

      1. Get Access Token: POST /auth/proxy/m2m/token using clientId and clientSecret.

      2. Get Session Ticket: POST /oem/setup using the

        access_token and user email.

    • Return a JSON response containing the

      ticket and the configured ASTRATO_BASE_URL.

  2. Frontend Implementation:

    • Create a simple login page with an email input and a "Log In" button.

    • On button click, call your local /api/login endpoint.

    • On success, redirect the top-level window to: {base_url}/auth/proxy/oem/ticket/{ticket}?embed.

  3. Configuration:

    • Use a

      .env file to store:

      • ASTRATO_CLIENT_ID

      • ASTRATO_CLIENT_SECRET

      • ASTRATO_BASE_URL (default: https://app.astrato.io)

    • CRITICAL WARNING: Explain that the CLIENT_ID and SECRET must be obtained from Administration -> System Settings -> OEM Management API. Do NOT use the Google OAuth credentials from the Enterprise Authentication section.

  4. Reference:

Attachment icon
Did this answer your question?