Skip to content

Commit

Permalink
experiment to see what is in the token and response
Browse files Browse the repository at this point in the history
  • Loading branch information
lme-nca committed Mar 14, 2024
1 parent 195e10c commit 178817f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dojo/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ def modify_permissions(backend, uid, user=None, social=None, *args, **kwargs):
pass


def update_keycloak_groups(backend, uid, user=None, social=None, *args, **kwargs):
if settings.KEYCLOAK_OAUTH2_ENABLED:
soc = user.social_auth.order_by("-created").first()
token = soc.extra_data['access_token']
print("accesstoken: " + str(token))
print("response raw: " + str(kwargs['response']))


def update_azure_groups(backend, uid, user=None, social=None, *args, **kwargs):
if settings.AZUREAD_TENANT_OAUTH2_ENABLED and settings.AZUREAD_TENANT_OAUTH2_GET_GROUPS and isinstance(backend, AzureADTenantOAuth2):
# In some wild cases, there could be two social auth users
Expand Down
1 change: 1 addition & 0 deletions dojo/settings/settings.dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ def generate_url(scheme, double_slashes, user, password, host, port, path, param
'social_core.pipeline.social_auth.load_extra_data',
'social_core.pipeline.user.user_details',
'dojo.pipeline.update_azure_groups',
'dojo.pipeline.update_keycloak_groups',
'dojo.pipeline.update_product_access',
)

Expand Down

0 comments on commit 178817f

Please sign in to comment.