Skip to content

Support for Custom URI Schemes in OAuth2 Redirect URIs for Mobile App Integration #34349

Open
@TwentyFiveSoftware

Description

@TwentyFiveSoftware

Description

Hi,

I'm trying to use Gitea as an OAuth provider for a Flutter mobile app, but I ran into a problem when setting up an OAuth2 Application. I want to use a redirect URI with custom scheme like com.example.example_app://callback, as this is a standard way to handle OAuth callbacks in mobile apps (i.e. as recommended in the flutter_appauth package documentation).

Unfortunately, Gitea doesn't seem to allow redirect URIs unless they start with http/https. That makes it hard to use Gitea with mobile apps that rely on custom schemes to handle OAuth callbacks. Other major OAuth providers like GitHub and GitLab do allow custom schemes, so I was surprised this isn't permitted in Gitea.

I found some Gitea integration tests related to the redirect URI validation, so I’m wondering if this was an intentional decision? Or maybe just an oversight?

It would be great if Gitea could support custom URI schemes for the OAuth redirect URIs.

Gitea Version

1.25.0+dev-9-gcbb2e52911 (current Gitea demo site version)

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

https://demo.gitea.com/

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions