Skip to content

[Enhancement] Support Multiple Redirect URIs per Client #7

@lcox74

Description

@lcox74

Requires: #5

Right now, each client only supports a single redirect_uri, stored as a plain string in the database and model. To support clients with multiple valid redirect URIs, we should extend the model and driver logic to handle multiple values without altering the existing SQLite schema.

Proposed Change

Since the database field is a TEXT column, we’ll store multiple URIs as a JSON array string and keep backward compatibility for existing single-URI entries.

Model/Driver Logic

  • If the redirect_uri field starts with [, parse it as a JSON array into RedirectURIs []string.
  • Otherwise, treat it as a single URI and wrap it into a one-element slice ([]string{redirect_uri}).
  • When writing back, always encode as JSON (even for one URI) to standardize future entries.

Authorization Flow

  • Update the /v1/oauth2/authorize endpoint to validate the requested redirect URI against any of the entries in RedirectURIs.
  • Continue to use exact match validation (canonicalized URIs, no wildcards).
  • Maintain compatibility with clients still using a single string value.

Implementation Notes

  • Modify the Client model and DB driver code to handle parsing and serialization of JSON arrays.
  • Update client registration logic to accept multiple redirect URIs via API.
  • Extend and Update the E2E tests for both the legacy single URI and Multiple URI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions