Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

non standard redirect_uri schemes #105

Open
ross opened this issue Sep 30, 2014 · 2 comments
Open

non standard redirect_uri schemes #105

ross opened this issue Sep 30, 2014 · 2 comments

Comments

@ross
Copy link
Contributor

ross commented Sep 30, 2014

it's common for mobile applications to use non-standard schemes that don't pass URLField's standard validations. iOS uses app specific schemes myapp://... and modern Windows uses ms-app://...

oauth2 provider works fine with these redirect_uri's set, but i have to go directly to the database to set them (going around the validations.)

really new Django allows a list of schemes to be passed to URLField/validators, but that won't really work here since iOS's schemes are app-specific. the only real solution i can think of is a more lenient URLField/validator for redirect_uri that doesn't check the scheme.

it could (perahps should) be an optional thing enabled with a setting, but i currently have run across several cases where i've had needed the ability to use a non-standard scheme.

@theladyjaye
Copy link

+1 I just ran into this same problem. I'm doing a desktop app (Cocoa) not an iOS app. Exactly the same situation though. For now I think I am just going to vendor this lib in and override:

https://github.com/caffeinehit/django-oauth2-provider/blob/master/provider/oauth2/models.py#L43

aka redirect_uri = models.URLField(help_text="Your application's callback URL")

basically going to subclass URLField and set the default_validators to use another custom subclass of URLValidator

@theladyjaye
Copy link

@ross this is my final patch for the time being [until they / if they] decide to patch it. It does require you to vendor the app into your project.

https://gist.github.com/aventurella/4467ff97fb4300c3a87d

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

No branches or pull requests

2 participants