-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
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_urifield starts with[, parse it as a JSON array intoRedirectURIs []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/authorizeendpoint to validate the requested redirect URI against any of the entries inRedirectURIs. - 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
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers