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

Client Credentials (M2M) support for Organizations #975

Merged

Conversation

kushalshit27
Copy link
Contributor

@kushalshit27 kushalshit27 commented Nov 6, 2024

🔧 Changes

Machine-to-Machine (M2M) Client Credentials Access for Organizations

📌 clientGrants resource :

clientGrants:
  - client_id: org m2m app
    audience: <url>
+   allow_any_organization: true
+   organization_usage: require
    scope:
      - <scope 1>
      - <scope 2>

Note:

  • organization_usage - string
    Possible values: [deny, allow, require]
    Defines whether organisations can be used with client credentials exchanges for this grant.

  • allow_any_organization - boolean
    If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organisations.

📌 organizations resource :

organizations:
  - name: new-org
+    client_grants:
+      - client_id: org m2m app 

Note:

  • client_id is mapped with clientGrants resource in YAML (or JSON)

📚 References

https://auth0.com/docs/manage-users/organizations/organizations-for-m2m-applications

🔬 Testing

  • updated unit test case for organization
  • updated e2e test case

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • I have added documentation for all new/changed functionality (or N/A)

@codecov-commenter
Copy link

codecov-commenter commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 58.82353% with 21 lines in your changes missing coverage. Please review.

Project coverage is 80.18%. Comparing base (d9aaca2) to head (f7c79a7).

Files with missing lines Patch % Lines
src/tools/auth0/handlers/organizations.ts 58.82% 14 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #975      +/-   ##
==========================================
- Coverage   80.49%   80.18%   -0.32%     
==========================================
  Files         113      113              
  Lines        3825     3871      +46     
  Branches      761      768       +7     
==========================================
+ Hits         3079     3104      +25     
- Misses        460      474      +14     
- Partials      286      293       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kushalshit27 kushalshit27 marked this pull request as ready for review November 6, 2024 12:21
@kushalshit27 kushalshit27 requested a review from a team as a code owner November 6, 2024 12:21
nandan-bhat
nandan-bhat previously approved these changes Nov 7, 2024
@kushalshit27 kushalshit27 merged commit a0d27af into master Nov 8, 2024
8 checks passed
@kushalshit27 kushalshit27 deleted the DXCDT-713-organization-support-client-credentials branch November 8, 2024 08:00
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

Successfully merging this pull request may close these issues.

3 participants