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

get_group_memberships_from_ms_graph returns only first 100 users #272

Open
freyp577 opened this issue Feb 9, 2023 · 6 comments
Open

get_group_memberships_from_ms_graph returns only first 100 users #272

freyp577 opened this issue Feb 9, 2023 · 6 comments

Comments

@freyp577
Copy link

freyp577 commented Feb 9, 2023

It looks like the method get_group_memberships_from_ms_graph in backend.py returns only the first 100 users
Unfortunatley we have usrs that have over 200 groups assigned

we are using django-auth-adfs with Azure AD
and the Microsft Graph API results have a size limit (of 100, in our case)

requiring the groups exceeding the limit
need to be fetched by repeating the reqest with '@odata.nextLink'
that is returned in this case with the batched result

could this be fixed / extended?

Fund with Polar
@JonasKs
Copy link
Member

JonasKs commented Feb 9, 2023

PR welcome 😊

@tim-schilling
Copy link
Member

Alternatively, you can subclass the ADFS backend and override get_group_memberships to do what you need it to.

@freyp577
Copy link
Author

freyp577 commented Feb 9, 2023

I am preparing a PR ...
currently testing it

@freyp577
Copy link
Author

freyp577 commented Feb 9, 2023

PR is hiere:

#274

@guillaumeldc
Copy link

Hi,

Where did we leave off with this request? I do have the same issue, believe it or not, I found use cases where users have 500+ groups in AD and won't want to customize the claim to return the groups attached to the application.
Please let me know if a PR is still needed but it seems like @freyp577 proposed a sound solution? @JonasKs what do you think?

@tim-schilling
Copy link
Member

There's an open PR but it has some things that need to be addressed. You can base your work off of that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants