Skip to content

Conversation

@tanya732
Copy link
Contributor

@tanya732 tanya732 commented Dec 10, 2025

Changes

Endpoint - POST /api/v2/self-service-profiles/{id}/sso-ticket

New request body property: New optional property added to optional provisioning_config property: google_workspace: { sync_users: boolean }

Validations added : provisioning_config must include at least one of scopes or google_workspace properties - including both is also acceptable.

Testing

  • Get Domain and apiToken from Auth0 Dashboard
// Create ManagementAPI instance
public static ManagementAPI api;
api = ManagementAPI.newBuilder("{DOMAIN}", "{API_TOKEN}").build();

// Create UserAttributeProfile
UserAttributeProfile createPayload = new UserAttributeProfile();
  createPayload.setName("User-Profile");

  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("User");
  userAttributes.setOidcMapping(oidcMapping);
  userAttributesMap.put("username", userAttributes);

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

  createPayload.setUserId(userId);
  createPayload.setUserAttributes(userAttributesMap);
  UserAttributeProfile createdUserAttributeProfile = api.userAttributeProfiles().create(createPayload).execute().getBody();


// Create a self-service profile
SelfServiceProfile createSSPPayload = new SelfServiceProfile();
createSSPPayload.setName("Test SSP");
createSSPPayload.setUserAttributeProfileId(createdUserAttributeProfile.getId());
SelfServiceProfileResponse createdSSP = api.selfServiceProfiles().create(createSSPPayload).execute().getBody();


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

// Note - _provisioning_config_ must include at least one of scopes or _google_workspace_ properties - including both is also acceptable.
ProvisioningConfig provisioningConfig = new ProvisioningConfig();
List<String> scopes = new ArrayList<>();
scopes.add("get:users");
provisioningConfig.setScopes(scopes);
provisioningConfig.setTokenLifetime(1000);
GoogleWorkspaceProvisioningConfig googleWorkspace = new GoogleWorkspaceProvisioningConfig();
googleWorkspace.setSyncUsers(true);
req.setProvisioningConfig(provisioningConfig);

SsoAccessTicketResponse resp = api.selfServiceProfiles().createSsoAccessTicket(createdSSP.getId(),req).execute().getBody();

Checklist

@tanya732 tanya732 requested a review from a team as a code owner December 10, 2025 05:42
@tanya732 tanya732 merged commit d100720 into master Dec 15, 2025
4 checks passed
@tanya732 tanya732 deleted the add-google-workspace-provisioning-java-support branch December 15, 2025 18:34
@tanya732 tanya732 mentioned this pull request Dec 18, 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