Skip to content

Move redirect URI validation to backend for non-registered case#721

Merged
rickyrombo merged 3 commits intomainfrom
mjp-oauth-default-redirect-uri-check
Mar 15, 2026
Merged

Move redirect URI validation to backend for non-registered case#721
rickyrombo merged 3 commits intomainfrom
mjp-oauth-default-redirect-uri-check

Conversation

@rickyrombo
Copy link
Contributor

Matches what is in https://github.com/AudiusProject/apps/blob/fc87e67a77d66cb47491740ff51e5c37fb2f7996/packages/web/src/pages/oauth-login-page/utils.ts#L13 but only runs on non-registered URIs. This way, custom mobile schemes can be registered and considered valid.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates OAuth authorization redirect URI validation so that apps with no registered redirect URIs (legacy/unconfigured) are validated by a backend format-based policy rather than accepting any value, while still requiring exact matches for apps that have registered URIs.

Changes:

  • Add backend fallback validation for redirect_uri when a client has no registered redirect URIs (http/https or postmessage; block creds/fragment/traversal/non-loopback IPs).
  • Refactor and expand OAuth authorize tests to cover accepted/rejected legacy redirect URI formats.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
api/v1_oauth.go Implements fallback redirect_uri format validation when no URIs are registered.
api/v1_oauth_test.go Adds helper seeding + multiple test cases for the new legacy validation rules.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rickyrombo and others added 2 commits March 14, 2026 17:21
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@rickyrombo rickyrombo merged commit 3b23e35 into main Mar 15, 2026
5 checks passed
@rickyrombo rickyrombo deleted the mjp-oauth-default-redirect-uri-check branch March 15, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants