add module oauth

This commit is contained in:
jorgepastorr 2023-09-18 09:20:32 +02:00
parent 52f28872f8
commit 5d905566c5
1 changed files with 41 additions and 0 deletions

41
README2.md Normal file
View File

@ -0,0 +1,41 @@
Para añadir las modificaciones de esta rama hay que modificar el fichero panel/panel settings.py
Añadir modulo en:
INSTALLED_APPS = [
...
'oauth2_provider',
]
seguido de la siguientes configuraciones:
MIDDLEWARE = (
...
#oauth
'oauth2_provider.middleware.OAuth2TokenMiddleware',
)
AUTHENTICATION_BACKENDS = [
...
'oauth2_provider.backends.OAuth2Backend',
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': (
...
'oauth2_provider.contrib.rest_framework.OAuth2Authentication',
),
}
OAUTH2_PROVIDER = {
# this is the list of available scopes
'SCOPES': {'read': 'Read scope', 'write': 'Write scope', 'groups': 'Access to your groups'}
}
Despues de assignar las anteriores configuraciones será necesario aplicar migrate
python3 manage.py migrate