Thanks to visit codestin.com
Credit goes to github.com

Skip to content

get_all_organization_members should support fields #534

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

Closed
5 tasks done
freyamade opened this issue Oct 11, 2023 · 2 comments · Fixed by #537
Closed
5 tasks done

get_all_organization_members should support fields #534

freyamade opened this issue Oct 11, 2023 · 2 comments · Fixed by #537
Labels
feature request A feature has been asked for or suggested by the community

Comments

@freyamade
Copy link

freyamade commented Oct 11, 2023

Checklist

  • I have looked into the Readme and Examples, and have not found a suitable solution or answer.
  • I have looked into the API documentation and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
  • I have searched the Auth0 Community forums and have not found a suitable solution or answer.
  • I agree to the terms within the Auth0 Code of Conduct.

Describe the problem you'd like to have solved

The endpoint for fetching all Organization members allows us to pass a fields parameter, specifically to include all member's roles in the response. The python library hides this option, and it would be much more performant to allow us to get all roles attached in one request instead of n^2 requests to fetch all users and then each user's roles in a separate request for each.

Describe the ideal solution

There are two ways it could play out, either by adding a include_roles flag, or by providing access to add more paramters via ** args to this and other functions.

Alternatives and current workarounds

The current way we have to do this is to do the following;

  1. Fetch all users in an organization
  2. Iterate over each user, sending a new request to fetch that user's roles specifically

Alternatively, we have been accessing variables and functions we shouldn't be, running something like;

auth0.organizations.client.get(auth0.organizations._url('<org_id>', "members"), params=dict(fields='user_id,name,email,roles'))

Additional context

No response

@freyamade freyamade added the feature request A feature has been asked for or suggested by the community label Oct 11, 2023
@adamjmcgrath
Copy link
Contributor

Thanks for raising this @freyamade - We have some work planned to update the SDKs with this new parameter, should happen in the next couple of weeks

@freyamade
Copy link
Author

Thank you so much 🙏

github-merge-queue bot pushed a commit that referenced this issue Oct 19, 2023
### Changes

Add `fields` and `include_fields` option to `all_organization_members`

### References

fixes #534
https://auth0.com/docs/api/management/v2/organizations/get-members
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A feature has been asked for or suggested by the community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants