Customize the schema

You can customize the number of objects written to the user record in the legalAcceptances plural. You can also customize the data written and stored within each object.

Number of legalAcceptances objects

By default, Hosted Login is built to support exactly two legal agreements the user must accept, as this is the most common business requirement. For example, (1) Terms of Use and (2) Privacy Policy. This means exactly two objects containing the legal acceptance IDs and metadata are written into the user record. legalAcceptances in user record

If you need to support a different number of legal agreements to be accepted by the user and individually written into the user record, please reach out to your Akamai Identity Cloud representative.

The logic that tells Hosted Login what to write into the user record can be modified by the Akamai Identity Cloud Professional Services team to support your specific needs.

Data in legalAcceptances objects

For each legal agreement the user accepts (e.g. Privacy Policy), an object is written to the user record containing four pieces of data:

  • clientId
  • dateAccepted
  • id (required for basic database functioning)
  • legalAcceptanceId

If you need to write additional pieces of data about the accepted legal agreements into the user record, you must follow a two-step process:

1. Add a new attribute

In the schema, add a new attribute to the legalAcceptances plural for each additional piece of data to be stored.

In this step, you’ll make RESTful API calls to the Identity Cloud using your platform or language of choice. We provide complete sample calls in cURL format.

New to making API calls?

You can add a new attribute to the schema by making an API call to the /entityType.addAttribute endpoint using the POST method.

  • The base URL for this call is your Registration Domain.

    Find my Registration Domain

  • This call requires Basic Authorization. To create the authorization code for this call, your application owner Client Id and Secret must be combined with a colon in between (id:secret) and then base64 encoded.

    Find my application owner Client Id and Secret
    How to create the authorization code in Postman

SAMPLE CALL:

curl -X POST \
	https://my-registration-domain.janraincapture.com/entityType.addAttribute \
	-H 'Authorization: Basic AUTHORIZATION CODE' \
	-H 'Content-Type: application/x-www-form-urlencoded' \
	--data-urlencode type_name=user \
	--data-urlencode attr_def='{"name":"legalAcceptances.myNewAttribute","type":"string","length":1000}'

Note the attr_def value used in this call:

'{"name":"legalAcceptances.myNewAttribute","type":"string","length":1000}'

This is the attribute definition in JSON format.

  • Specifying the attribute name as legalAcceptances.myNewAttribute places a new attribute named “myNewAttribute” into the legalAcceptances plural. This dot notation can be used anytime you need to add a new attribute to an existing plural or object in the schema.
  • This attribute definition creates a string attribute with a max length of 1000 characters. You may need to create a different type of attribute with different constraints. For more information, see Managing Your Schema.

If successful, you can immediately see your new attribute in the Identity Cloud Console. Navigate to MANAGE SCHEMAS > your schema (e.g. user). Scroll to the legalAcceptances plural (in the Name column) and click on it to open and view your new attribute.

New legalAcceptances attribute in schema

2. Write to the new attribute

To write data to the new attribute(s), reach out to your Akamai Identity Cloud representative. The logic that tells Hosted Login what to write into the user record can be modified by the Akamai Identity Cloud Professional Services team to support your specific needs.