Skip to content

Conversation

@tanya732
Copy link
Contributor

@tanya732 tanya732 commented Sep 16, 2025

Changes

Added new /user-attribute-profiles endpoints, and modified /self-service-profiles and /self-service-profiles/{id}/sso-ticket endpoints

Path HTTP Method Method Name
/user-attribute-profiles/{id} DELETE delete
/user-attribute-profiles/templates/{id} GET getTemplate
/user-attribute-profiles/templates GET getAllTemplates
/user-attribute-profiles GET getAll
/user-attribute-profiles/{id} GET get
/user-attribute-profiles/{id} PATCH update
/user-attribute-profiles POST create
/self-service-profiles POST create
/self-service-profiles GET get
self-service-profiles/{id} PATCH update
self-service-profiles/{id} GET get
/self-service-profiles/{id}/sso-ticket POST createSsoTicket

Manual Testing Code

install node-auth0 using npm install auth0

//Get DOMAIN, CLIENT_ID, CLIENT_SECRET from auth0 dashboard and create Management Client

const auth0 = new ManagementClient({
    domain: "<DOMAIN>",
    clientId: "<CLIENT_ID>",
    clientSecret: "<CLIENT_SECRET>"
});

// Create a User Attribute Profile

const createPayload: CreateUserAttributeProfileRequestContent = {
    name: "Test - 2",
    user_attributes: {
        username: {
          description: "This is just a test",
          label: "testUser",
          profile_required: false,
          auth0_mapping: "testUser",
          oidc_mapping: "preferred_username"
        }
      }
  }

  const createUserAttributeProfiles = await client.userAttributeProfiles.create(createPayload);
  console.log("createUserAttributeProfiles", createUserAttributeProfiles.data);

// Update a User Attribute Profile

  const updatePayload: UpdateUserAttributeProfileRequestContent = {
    user_id: {
      scim_mapping: "customMappingValue",
      saml_mapping: "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",
      oidc_mapping: "sub"
    }
  }

  const updateUserAttributeProfiles = await client.userAttributeProfiles.update({ id: createUserAttr.data.id! }, updatePayload);
  console.log("updateUserAttributeProfiles", updateUserAttributeProfiles.data);

// GET a User Attribute Profile

  const getUserAttributeProfiles = await client.userAttributeProfiles.get({ id: createUserAttr.data.id! });
  console.log("getUserAttributeProfiles", getUserAttributeProfiles.data);

// GET-ALL User Attribute Profiles, with Checkpoint Pagination

  const getAllUserAttributeProfiles = await client.userAttributeProfiles.getAll();
  console.log("getAllUserAttributeProfiles", getAllUserAttributeProfiles.data);

// GET User Attribute Profile Template

  const getAttributeProfilesTemplate = await client.userAttributeProfiles.getTemplate({ id: createUserAttr.data.id! });
  console.log("getUserAttributeProfilesTemplate", getUserAttributeProfilesTemplate.data);

// GET User Attribute Profile Templates, but not with Checkpoint Pagination

  const getAllUserAttributeProfilesTemplate = await client.userAttributeProfiles.getAllTemplates();
  console.log("getAllUserAttributeProfilesTemplate", getAllUserAttributeProfilesTemplate.data);
 
 // Update SS Profile with user_attribute_profile_id instead of user_attributes
 
 const updateSSPPayload: SsProfileUpdate = {
    user_attribute_profile_id: "<ID>",
  }
  const updatedSSP = await client.selfServiceProfiles.update({id : getSSP.data.id!}, updateSSPPayload);
  console.log("updatedSSP", updatedSSP.data);

 // Get All SS Profiles

  const getAllSSP = await client.selfServiceProfiles.getAll();
  console.log("getAllSSP", getAllSSP.data);

 // Get SS Profiles

  const getSSP = await client.selfServiceProfiles.get({id : getAllSSP.data[0].id!});
  console.log("getSSP", getSSP.data);

// Creation of a ticket with the new provisioning_config property

const createSsoTicket: PostSsoTicketRequest = {
    connection_config: {
      name: "Test-Con-1"
    },
    enabled_clients: ["<CLIENT>"],
    provisioning_config: {
      scopes: ["get:users"],
      token_lifetime: 10000
    }
  }
  const createdSSOTicket = await client.selfServiceProfiles.createSsoTicket({id: getSSP.data.id!},createSsoTicket);
  console.log("createdSSOTicket", createdSSOTicket.data);
  

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 September 16, 2025 11:03
@tanya732 tanya732 requested a review from a team as a code owner September 16, 2025 11:03
@tanya732 tanya732 merged commit f8ecb85 into v4 Sep 26, 2025
5 checks passed
@tanya732 tanya732 deleted the sdk-6422-Add-Support-for-Self-Service-Provisioning branch September 26, 2025 08:01
This was referenced Sep 29, 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.

4 participants