Skip to content

Added policies in clients endpoint (GET/PATCH/POST) #1103

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tanya732
Copy link
Contributor

@tanya732 tanya732 commented Apr 15, 2025

Changes

Added policies in RefreshToken

Path HTTP Method Method Name
/clients POST create
/clients GET getAll
/clients/{id} GET get
/clients/{id} PATCH update

References

https://oktawiki.atlassian.net/wiki/spaces/TES/pages/3209493533/PRD+-+My+Account+Resource+Server

Manual Testing

  • Securely store your Client ID, Client Secret, and Management API token.
  • Install the SDK: npm install auth0
var auth0 = new ManagementClient({
domain: '{YOUR_TENANT_AND REGION}.auth0.com',
clientId: '{YOUR_CLIENT_ID}',
clientSecret: '{YOUR_CLIENT_SECRET}',
});

const createClientPayload: ClientCreate = {
  name: "My Client",
  is_first_party: true,
  oidc_conformant: true,
  sso_disabled: false,
  oidc_logout: {
    backchannel_logout_urls: [
      "https://test.com/backchannel-logout-new"
    ]
  },
  refresh_token: {
    expiration_type: "expiring",
    leeway: 0,
    infinite_token_lifetime: false,
    infinite_idle_token_lifetime: false,
    token_lifetime: 31557600,
    idle_token_lifetime: 2592000,
    rotation_type: "rotating",
    policies: [
      {
        audience: "https://firstresourceserver/",
        scope: ["rs:read"]
      },
      {
        audience: "https://secondresourceserver/",
        scope: ["rs:read", "rs:write"]
      }
    ]
  },
  grant_types: [
    "authorization_code",
    "refresh_token",
    "client_credentials"
  ]
};


const data = await auth0.clients.create(createClientPayload);

Testing

Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.

  • This change adds unit test coverage
  • This change adds integration test coverage

Checklist

@tanya732 tanya732 marked this pull request as ready for review April 21, 2025 13:13
@tanya732 tanya732 requested a review from a team as a code owner April 21, 2025 13:13
Copy link
Contributor

@kushalshit27 kushalshit27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add code example

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.

2 participants