Skip to content

Conversation

@tanya732
Copy link
Contributor

@tanya732 tanya732 commented Sep 25, 2025

Changes

Below are the changes in following endpoints

Change Type Method Endpoint
NEW GET /api/v2/user-attribute-profiles/templates
NEW GET /api/v2/user-attribute-profiles/templates/{id}
NEW POST /api/v2/user-attribute-profiles
NEW GET /api/v2/user-attribute-profiles
NEW PATCH /api/v2/user-attribute-profiles/{id}
NEW GET /api/v2/user-attribute-profiles/{id}
NEW DELETE /api/v2/user-attribute-profiles/{id}
MODIFIED POST /api/v2/self-service-profiles
MODIFIED GET /api/v2/self-service-profiles
MODIFIED PATCH /api/v2/self-service-profiles/{id}
MODIFIED GET /api/v2/self-service-profiles/{id}

References

Please include relevant links supporting this change such as a:

  • support ticket
  • community post
  • StackOverflow post
  • support forum thread

Manual Testing Code

Get Domain and apiToken from Auth0 Dashboard

public static ManagementAPI api;
api = ManagementAPI.newBuilder("{DOMAIN}", "{API_TOKEN}").build();

  // Create a user attribute profile
  UserAttributeProfile createPayload = new UserAttributeProfile();
  createPayload.setName("This is just a test");

  Map<String, UserAttributes> userAttributesMap = new HashMap<>();
  UserAttributes userAttributes = new UserAttributes();
  userAttributes.setDescription("This is just a test");
  userAttributes.setLabel("test User");
  userAttributes.setProfileRequired(false);
  userAttributes.setAuth0Mapping("testUser");

  OidcMapping oidcMapping = new OidcMapping();
  oidcMapping.setMapping("preferred_username");
  oidcMapping.setDisplayName("Display Name");
  userAttributes.setOidcMapping(oidcMapping);
  userAttributesMap.put("username", userAttributes);

  UserId userId = new UserId();
  userId.setSamlMapping(Arrays.asList("urn:oid:0.9.10.10.100.1.1"));
  userId.setOidcMapping("sub");
  userId.setScimMapping("userName");

  createPayload.setUserId(userId);
  createPayload.setUserAttributes(userAttributesMap);
  UserAttributeProfile createdUserAttributeProfile = api.userAttributeProfiles().create(createPayload).execute().getBody();
  System.out.println("Created User Attribute Profile: " + createdUserAttributeProfile.getId());

  //  Update the user attribute profile
  UserAttributeProfile updatePayload = new UserAttributeProfile();
  updatePayload.setName("Updated This is another test");
  UserAttributeProfile updatedUserAttributeProfile = api.userAttributeProfiles().update("<ID>", updatePayload).execute().getBody();
  System.out.println("Updated User Attribute Profile: " + updatedUserAttributeProfile.getId() + " " + updatedUserAttributeProfile.getName());

  // Get the user attribute profile
  UserAttributeProfile getUserAttributeProfile = api.userAttributeProfiles().get("<ID>").execute().getBody();
  System.out.println("Fetched User Attribute Profile: " + getUserAttributeProfile.getId());

  //  Get all user attribute profiles
  ListUserAttributeProfile getAllUserAttributeProfile = api.userAttributeProfiles().getAll(new UserAttributeProfilesFilter().withCheckpointPagination("<FROM>", 10)).execute().getBody();
  System.out.println("All User Attribute Profile: " + getAllUserAttributeProfile.getUserAttributeProfiles());

  //  Get user attribute profile Template
  UserAttributeProfileTemplate getUserAttributeProfileTemplate = api.userAttributeProfiles().getTemplate("auth0-generic").execute().getBody();
  System.out.println("All User Attribute Profile Template: " + getUserAttributeProfileTemplate.getDisplayName());


  //  Get all user attribute profile Template
  ListUserAttributeProfileTemplate getAllUserAttributeProfileTemplate = api.userAttributeProfiles().getAllTemplates().execute().getBody();
  System.out.println("All User Attribute Profile: " + getAllUserAttributeProfileTemplate.getUserAttributeProfileTemplates());

  //  Create a self-service profile
  SelfServiceProfile createSSPPayload = new SelfServiceProfile();
  createSSPPayload.setName("Test SSP");
  createSSPPayload.setUserAttributeProfileId("<ID>");
  SelfServiceProfile createdSSP = api.selfServiceProfiles().create(createSSPPayload).execute().getBody();
  System.out.println("created SSP: " + createdSSP.getUserAttributeProfileId());

  //  Update a self-service profile
  SelfServiceProfile updateSSPPayload = new SelfServiceProfile();
  // Note - user_attributes not allowed in the same profile
  updateSSPPayload.setUserAttributeProfileId("<ID>");
  SelfServiceProfile updatedSSP = api.selfServiceProfiles().update(updateSSPPayload, "<SSP_ID>").execute().getBody();
  System.out.println("Updated SSP: " + updatedSSP.getUserAttributeProfileId());
  
  // Get self-service profile
  SelfServiceProfile getSSP = api.selfServiceProfiles().getById("<SSP_ID>").execute().getBody();
  System.out.println("get SSP: " + getSSP.getUserAttributeProfileId());

  
  //Create an SSO Access Ticket
  SsoAccessTicketRequest req = new SsoAccessTicketRequest();
  Map<String, Object> config = new HashMap<>();
  config.put("name", "Test-Con-1");
  req.setConnectionConfig(config);

  ProvisioningConfig provisioningConfig = new ProvisioningConfig();
  List<String> scopes = new ArrayList<>();
  scopes.add("get:users");
  provisioningConfig.setScopes(scopes);
  provisioningConfig.setTokenLifetime(1000);
  req.setProvisioningConfig(provisioningConfig);

  SsoAccessTicketResponse resp = api.selfServiceProfiles().createSsoAccessTicket("<SSP_ID>",req).execute().getBody();
  System.out.println("SSO Ticket: " + resp.getTicket());

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 test coverage
  • This change has been tested on the latest version of the platform/language or why not

Checklist

@tanya732 tanya732 requested a review from a team as a code owner September 25, 2025 05:59
pmathew92
pmathew92 previously approved these changes Sep 25, 2025
private void applyFilter(UserAttributeProfilesFilter filter, HttpUrl.Builder builder) {
if (filter != null) {
filter.getAsMap().forEach((k, v) -> builder.addQueryParameter(k, String.valueOf(v)));
}

Choose a reason for hiding this comment

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

Do you need a separate method for this ,as it is used only from the getAll method ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have updated the method

pmathew92
pmathew92 previously approved these changes Sep 29, 2025
@tanya732 tanya732 merged commit cec49b2 into master Sep 29, 2025
5 checks passed
@tanya732 tanya732 deleted the sdk-6843-self-service-provisioning-java-support branch September 29, 2025 07:39
tanya732 added a commit that referenced this pull request Sep 30, 2025
@tanya732 tanya732 changed the title Sdk 6843 self service provisioning java support Self service provisioning java support Nov 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.

3 participants