SCIM Group Response Converter Lambda

SCIM Group Response Converter Lambda

If you would like to convert an outgoing FusionAuth Group response into a SCIM Group, you must specify a lambda in the SCIM configuration. This lambda will be invoked after the Group was acted upon.

When you create a new lambda using the FusionAuth UI we will provide you an empty function for you to implement. If you are using the API to create the lambda you will need to ensure your function has the following signature:

function convert(scimGroup, group, members) {
  // Lambda code goes here
}

This lambda must contain a function named convert that takes three parameters. The parameters that the lambda is passed are:

  • scimGroup - the SCIM Group object
  • group - the FusionAuth Group object
  • members - the members in this FusionAuth Group

The FusionAuth group object is well documented here in the Group API documentation. The members object is an array of user objects, well documented in the User API. The SCIM Group object is a JavaScript object containing the SCIM Group response JSON payload. See SCIM Group.

You may add or modify anything in the scimGroup object.

Assigning the Lambda

Once a lambda is created, you must assign it to a Tenant. See the SCIM tab in the Tenant configuration.

Default Lambda

A default SCIM Group Response Converter Lambda that converts an outgoing FusionAuth Group response to a SCIM Group is available and may be used or modified. The lambda function is documented below.

function convert(scimGroup, group, members) {
  // Un-comment this line to see the group object printed to the event log
  // console.info(JSON.stringify(group, null, 2));

  // Set the outgoing displayName on the SCIM group using the FusionAuth group name.
  scimGroup.displayName = group.name;
}