Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new azure flag to obtain groups from the oidc ticket #2531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tupos
Copy link

@tupos tupos commented Feb 28, 2024

Description

It is possible in azure to configure an optional claim such as groups. In this case there is no need to make a request to Microsoft Graph api to obtain groups. Instead azure will send the configured groups as a part of oidc ticket directly. This is usefull when it is not possible to obtain GroupMember.Read.All permissions for the application, for example
for a large org where additional permissions are not desirable.

Here we provide a new flag --azure-groups-in-ticket, which does exactly this. When the flag is set the request to the Graph api is not done and instead the groups are taken from the session directly.

Motivation and Context

In the large org it is not always possible to obtain admin consent for GroupMember.Read.All entra id api permission.
However, there is already a possibility to get groups in the azure oidc ticket without any additional api permissions.

How Has This Been Tested?

It is tested locally with a test entra tenant. Unit tests are provided.

In addition, in the current master the test TestAzureProviderEnrichSession is broken,
as the branch, which tests that the groups are fetched from the graph api is never executed.

(This can be easily verified by inserting panic into testAzureBackendWithError into the
first if branch)

This is also fixed in this PR. Now the test also correctly tests fetch from the graph api.

To run the test just execute go test -v -run TestAzureProviderEnrichSession

All the test suite in the providers package run without failures.

Checklist:

  • My change requires a change to the documentation or CHANGELOG.
  • I have updated the documentation/CHANGELOG accordingly.
  • I have created a feature (non-master) branch for my PR.
  • I have written tests for my code changes.

It is possible in azure to configure an optional claim such as groups.
In this case there is no need to make a request to Microsoft Graph api
to obtain groups. Instead azure will send the configured groups as a
part of oidc ticket directly. This is usefull when it is not possible to
obtain GroupMember.Read.All permissions for the applictaion.

Here we provide a new flag `azure-groups-in-ticket`, which does exactly
this. When the flag is set the request to the Graph api is not done and
instead the groups are taken from the session directly.
@tupos tupos force-pushed the azure_groups_in_ticket branch from ce52091 to 5eddf25 Compare February 28, 2024 22:30
@tupos
Copy link
Author

tupos commented Mar 7, 2024

Hello, any comment here?

1 similar comment
@tupos
Copy link
Author

tupos commented Mar 17, 2024

Hello, any comment here?

Copy link
Contributor

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

@github-actions github-actions bot added the Stale label May 17, 2024
@github-actions github-actions bot closed this May 24, 2024
@tuunit tuunit reopened this Jun 23, 2024
@tuunit tuunit removed the Stale label Jun 23, 2024
Copy link
Contributor

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

@github-actions github-actions bot added the Stale label Aug 23, 2024
@github-actions github-actions bot closed this Sep 1, 2024
@tupos
Copy link
Author

tupos commented Sep 8, 2024

Hello, are there any news here?

@tuunit tuunit reopened this Sep 15, 2024
@tuunit tuunit removed the Stale label Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants