From 5d905566c5f6c9f966a9067bb5a86ceea9967972 Mon Sep 17 00:00:00 2001 From: jorgepastorr Date: Mon, 18 Sep 2023 09:20:32 +0200 Subject: [PATCH] add module oauth --- README2.md | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 README2.md diff --git a/README2.md b/README2.md new file mode 100644 index 00000000..aac8f329 --- /dev/null +++ b/README2.md @@ -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 +