Logins Fail for Particular Connection when Actions are Enabled with Error "cannot unmarshal string"

Last Updated: Dec 6, 2024

Overview

Users from one SAML connection are not able to log in. The following error is present in the logs:

json: cannot unmarshal string into Go struct field .event.user.userMetadata of type map[string]interface {}

When actions are disabled, the users can log in.

Applies To

  • Actions
  • SAML Connection

Cause

It is important that the field “user_metadata” is not passed by an external IdP. When Auth0 maps user_metadata from a SAML attribute, it converts an object into a string, which can cause this issue.

Solution

Impacted users will need their user_metadata cleared once this is resolved before Actions can function for those users, or if it cannot be resolved on the IdP’s side, turn off profile sync on the connection and clear metadata for all existing users and future users.

Metadata should only be managed by Rules/Actions, Authentication API, Management API, Tenant Dashboard, or the Lock Library.

Related References