Epic Games Reconcile Lambda
When an Epic Games identity provider is used to complete a federated login request, FusionAuth will use the configured linking strategy to reconcile the user. FusionAuth will attempt to match the user information returned from the Epic Games identity provider to an existing user account or create a new one.
You may optionally utilize a lambda to customize the user and user registration during the authentication event.
When you create a new lambda using the FusionAuth administrative user interface, you will be provided an empty function to implement.
Lambda Structure
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 the following parameters. The parameters that the lambda is passed are:
user
- the FusionAuth User object. You can modify this object. However, theemail
andusername
attributes may not be modified after the user has been linked.registration
- the FusionAuth UserRegistration object. You can modify this object.
userInfo
- data returned by the Epic Games Account API. This object is read-only.
The two FusionAuth objects are well documented in the User API and Registration API documentation. The idToken
may contain various user claims depending upon the user’s Epic Games configuration.
Assigning The Lambda
Once a lambda is created, you may assign it to the Epic Games identity provider in the IdP configuration.
Navigate to Settings -> Identity Providers and select your existing Epic Games configuration or click Add provider and select Epic Games if it has not yet been configured.