Nintendo Reconcile Lambda

Nintendo Reconcile lambda

When an Nintendo identity provider is used to complete a federated login request to reconcile a user. Please note, there are multiple linking strategies when attempting to reconcile the user. Nintendo defaults to CreatePendingLink. You may optionally utilize a lambda to customize the user and user registration during this authentication event.

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 reconcile(user, registration, userInfo) {
  // Lambda code goes here
}

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

  • user - the FusionAuth User object. You can modify this, except the email or username attribute may not be modified after the user has been linked.
  • registration - the FusionAuth UserRegistration object. You can modify this.
  • userInfo - the JSON payload returned by the Nintendo Token Info API. This is read-only.

The two FusionAuth objects are well documented here in the User API and Registration API documentation. The userInfo may contain various user claims depending upon the user’s Nintendo configuration.

Assigning the lambda

Once a lambda is created, you may assign it to the Nintendo identity provider in the IdP configuration.

Navigate to Settings -> Identity Providers and select your existing Nintendo configuration or click Add provider and select Nintendo if it has not yet been configured.