Customizing the Flow of the User Experience

Important. Much of the content on this page deals with a legacy feature of the Akamai Identity Cloud (in this case, the JavaScript SDK). If you are currently an Identity Cloud customer and are using the JavaScript SDK, that SDK is still supported. However, if you’re new to the Identity Cloud the JavaScript SDK is no longer available. Instead, you should use Hosted Login for your login and registration needs.

How do I create or delete forms?

You can use either Console or the Identity Cloud Configuration APIs to create and delete forms. To create a form by using Console, see the article Creating a Form; for information on deleting forms by using Console, see Deleting a Form.

If you prefer working with the APIs, forms can be created by using the /config/{appId}/flows/{flow}/forms endpoint and the POST method. Similarly, forms can be deleted by using the /config/{appId}/flows/{flow}/forms/{form} endpoint and the DELETE method.



How do I personalize the user’s experience after login?

Some pieces of information, such as uuid, email and displayName, can be made available locally without the need for making API calls. This information can be used to personalize an user’s experience, such as by displaying their username upon logon.

One way to get this information is to add a function handler to the onCaptureLoginSuccess event, and then to access it via the userData object:

  janrain.events.onCaptureLoginSuccess.addHandler(function(result){
      vardisplayName = result.userData.displayName;
      // Use displayName in some way...
  });

Another method is to persist this information via local storage, and then to extract it later (such as for a welcome message upon an user’s return to your site). To do this, both the setProfileCookie and returnExperienceUserData settings need to be enabled.

janrian.settings.capture.setProfileCookie = true;
janrian.settings.capture.returnExperienceUserData = ["displayName","email"];

These will make available uuid, email, and displayName in a JSON object, inside the janrainCaptureProfileData local storage key. To access this information, you can then utilize the getprofilecookiedata JavaScript function:

vardisplayName = janrain.capture.ui.getProfileCookieData('displayName');

This also makes the data available in janrainCaptureReturnExperienceData, which can be accessed via the getReturnExperienceData function:

janrain.capture.ui.getReturnExperienceData('displayName');

Extending the Local Profile Information

Should you wish to make available more information than uuid, email, and displayName, then you will need to make a Flow change. To do this, make a PUT request on the userData object via the /config/{app}/Flows/{Flow} endpoint with the additional information you want made available:

{
  "userData": [
    "email",
    "displayName",
    "familyName",
    "primaryAddress.country"
  ],
  "schemas": [
    "myCoolEntityType"
  ]
}

Finally, remember to update your returnExperienceUserData setting with the appropriate attributes:

janrian.settings.capture.returnExperienceUserData = ["displayName","email","familyName","primaryAddress.country"];



How do I pre-populate a form with data returned from an identity provider?

After an user authenticates socially from the signIn form, you may want to pre-populate the socialRegistration form with additional information returned from the social profile. This can be enabled for a field by adding the socialProfileData key to it.

To do this, add or update a field to include the socialProfileData key, like in the example below. Note that this key can only be added to “text”, “email”, and “textarea” type fields.

{
  "type": "text",
   "name": "myCustomTextField",
   "schemaAttribute": "displayName",
   "label": "My Custom Text Field",
   "socialProfileData": "profile.displayName" 
}