Skip to content

[Backend] Implement Offline/Mock Mode for External IdP Validation #91

@MohamadNazik

Description

@MohamadNazik

Description:
Currently, the Backend Core service (backend-services/core) uses getEnvRequired for all EXTERNAL_IDP_* environment variables. This causes the server to panic on startup if these variables are missing or if the server cannot reach api.asgardeo.io (e.g., due to local network restrictions or timeout).

Proposed Solution:
Introduce a "Mock Mode" toggled via APP_ENV=dev. When active:

  1. The server should not panic if EXTERNAL_IDP_* variables are missing.
  2. The validator should be replaced with a mock version.

Acceptance Criteria:

  • Backend server starts successfully even when the PC is offline (no connection to Asgardeo).
  • Backend server starts successfully when EXTERNAL_IDP_* environment variables are empty or missing in APP_ENV=dev.
  • The API accepts JWT tokens issued by the local token-service (localhost:8081) for authenticated routes.
  • Security remains unchanged in APP_ENV=prod (must still require and verify real Asgardeo tokens).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions