Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion oauth2_provider/generators.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def hash(self):

class ClientSecretGenerator(BaseHashGenerator):
def hash(self):
return oauthlib_generate_client_id(length=128, chars=CLIENT_ID_CHARACTER_SET)
return oauthlib_generate_client_id(length=oauth2_settings.CLIENT_SECRET_GENERATOR_LENGTH, chars=CLIENT_ID_CHARACTER_SET)


def generate_client_id():
Expand Down
2 changes: 1 addition & 1 deletion oauth2_provider/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AbstractApplication(models.Model):

client_id = models.CharField(max_length=100, unique=True,
default=generate_client_id, db_index=True)
user = models.ForeignKey(AUTH_USER_MODEL)
user = models.ForeignKey(AUTH_USER_MODEL, related_name="%(app_label)s_%(class)s")
help_text = _("Allowed URIs list, space separated")
redirect_uris = models.TextField(help_text=help_text,
validators=[validate_uris], blank=True)
Expand Down
1 change: 1 addition & 0 deletions oauth2_provider/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
DEFAULTS = {
'CLIENT_ID_GENERATOR_CLASS': 'oauth2_provider.generators.ClientIdGenerator',
'CLIENT_SECRET_GENERATOR_CLASS': 'oauth2_provider.generators.ClientSecretGenerator',
'CLIENT_SECRET_GENERATOR_LENGTH': 128,
'OAUTH2_VALIDATOR_CLASS': 'oauth2_provider.oauth2_validators.OAuth2Validator',
'SCOPES': {"read": "Reading scope", "write": "Writing scope"},
'READ_SCOPE': 'read',
Expand Down