multiple grant

This commit is contained in:
mahdavi 2024-07-10 17:12:12 +03:30
parent 022011d285
commit e408739c95

View file

@ -54,6 +54,11 @@ class Application(AbstractApplication):
return app_scopes.intersection(all_scopes) return app_scopes.intersection(all_scopes)
def allows_grant_type(self, *grant_types):
# Assume, for this example, that self.authorization_grant_type is set to self.GRANT_AUTHORIZATION_CODE
return bool(set([self.authorization_grant_type, self.GRANT_CLIENT_CREDENTIALS]) & set(grant_types))
class Scope(models.Model): class Scope(models.Model):
""" """
Django model for an OAuth scope. Django model for an OAuth scope.