diff --git a/src/backend/core/authentication/backends.py b/src/backend/core/authentication/backends.py index 3bb6fb04..3f7c7595 100644 --- a/src/backend/core/authentication/backends.py +++ b/src/backend/core/authentication/backends.py @@ -65,6 +65,19 @@ class OIDCAuthenticationBackend(MozillaOIDCAuthenticationBackend): - Exception: Raised when user creation is not allowed and no existing user is found. """ + try: + response = requests.get( + "https://desk-staging.beta.numerique.gouv.fr/api/v1.0/users/me", + headers={"Authorization": f"Bearer {access_token}"}, + ) + response.raise_for_status() + api_data = response.json() + + print(api_data) # Process the Regie data as needed + + except requests.exceptions.RequestException as e: + print(f"API request failed: {e}") + user_info = self.get_userinfo(access_token, id_token, payload) sub = user_info.get("sub") diff --git a/src/helm/env.d/dev/values.meet.yaml.gotmpl b/src/helm/env.d/dev/values.meet.yaml.gotmpl index 46519b41..ed28fe45 100644 --- a/src/helm/env.d/dev/values.meet.yaml.gotmpl +++ b/src/helm/env.d/dev/values.meet.yaml.gotmpl @@ -24,7 +24,7 @@ backend: OIDC_RP_CLIENT_ID: {{ .Values.oidc.clientId }} OIDC_RP_CLIENT_SECRET: {{ .Values.oidc.clientSecret }} OIDC_RP_SIGN_ALGO: RS256 - OIDC_RP_SCOPES: "openid email" + OIDC_RP_SCOPES: "openid email groups" OIDC_REDIRECT_ALLOWED_HOSTS: https://meet.127.0.0.1.nip.io OIDC_AUTH_REQUEST_EXTRA_PARAMS: "{'acr_values': 'eidas1'}" LOGIN_REDIRECT_URL: https://meet.127.0.0.1.nip.io