Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions oauth2_provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ def redirect_uri_allowed(self, uri):

:param uri: Url to check
"""
return uri in self.redirect_uris.split()
for allowed_uri in self.redirect_uris.split():
if uri.startswith(allowed_uri):
return True
return False

def clean(self):
from django.core.exceptions import ValidationError
Expand Down Expand Up @@ -148,7 +151,7 @@ def is_expired(self):
return timezone.now() >= self.expires

def redirect_uri_allowed(self, uri):
return uri == self.redirect_uri
return uri.split('?')[0] == self.redirect_uri.split('?')[0]
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to use the urlparse (or Py3 urllib.parse) to do this kind of extraction.


def __str__(self):
return self.code
Expand Down