user gooyal oauth

This commit is contained in:
mahdavi 2020-06-09 17:44:30 +04:30
parent bfb69353bf
commit 513163fc56
3 changed files with 11 additions and 8 deletions

View file

@ -10,6 +10,10 @@ class Migration(migrations.Migration):
initial = True
run_before = [
('oauth2_provider', '0001_initial'),
]
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
migrations.swappable_dependency(settings.OAUTH2_PROVIDER_APPLICATION_MODEL),

View file

@ -58,26 +58,25 @@ MIDDLEWARE = [
'corsheaders.middleware.CorsMiddleware',
]
# Tell Django OAuth Toolkit to use the RestrictedApplication model
OAUTH2_PROVIDER_APPLICATION_MODEL = 'gooyal_restrict_scopes.RestrictedApplication'
# Tell Django OAuth Toolkit to use the Gooyal Application model
OAUTH2_PROVIDER_APPLICATION_MODEL = 'gooyal_oauth.Application'
OAUTH2_PROVIDER_ACCESS_TOKEN_MODEL = 'oauth2_provider.AccessToken'
OAUTH2_PROVIDER_GRANT_MODEL = 'oauth2_provider.Grant'
OAUTH2_PROVIDER_REFRESH_TOKEN_MODEL = 'oauth2_provider.RefreshToken'
OAUTH2_PROVIDER = {
# this is the list of available scopes
# 'SCOPES_BACKEND_CLASS': 'apps.gooyal_restrict_scopes.scopes.RestrictApplicationScopes',
'SCOPES_BACKEND_CLASS': 'apps.gooyal_dynamic_scopes.scopes.DynamicScopes',
'SCOPES_BACKEND_CLASS': 'apps.gooyal_oauth.scopes.Scopes',
'SCOPES': {'read': 'Read scope',
'write': 'Write scope',
'groups': 'Access to your groups',
'introspection': 'Introspect token scope'},
'OAUTH2_VALIDATOR_CLASS': 'utils.oauth2_provider.MultiGatewayOAuth2Validator'
'OAUTH2_VALIDATOR_CLASS': 'apps.gooyal_oauth.validators.MultiGatewayOAuth2Validator'
}
GOOYAL_RESTRICT_SCOPES = {
'WRAPPED_SCOPES_BACKEND_CLASS': 'oauth2_provider.scopes.SettingsScopes',
}
# GOOYAL_RESTRICT_SCOPES = {
# 'WRAPPED_SCOPES_BACKEND_CLASS': 'oauth2_provider.scopes.SettingsScopes',
# }
# GOOYAL_DYNAMIC_SCOPES