Skip to content

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

Merged
tanya732 merged 2 commits into
masterfrom
sdk-my-account-resource-server-node-auth0-support
May 6, 2025
Merged

Added policies in clients endpoint (GET/PATCH/POST)#1103
tanya732 merged 2 commits into
masterfrom
sdk-my-account-resource-server-node-auth0-support

Conversation

@tanya732
Copy link
Copy Markdown
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
Copy Markdown
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

@tanya732
Copy link
Copy Markdown
Contributor Author

tanya732 commented May 5, 2025

Please add code example

I have added code samples

@tanya732 tanya732 merged commit 405ad8c into master May 6, 2025
8 checks passed
@tanya732 tanya732 deleted the sdk-my-account-resource-server-node-auth0-support branch May 6, 2025 04:38
@tanya732 tanya732 mentioned this pull request May 6, 2025
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