After linking user accounts in an action or rule, the authentication is not completed successfully, and SSO does not work.
This can happen if the user logging in has been linked as a secondary user and a code to assign the linked primary user as the active user session is not called.
This can happen if the current user logging in has been linked as a secondary user. Then, within the rule or action, the following code needs to update the user with the linked primary user ID.
context.primaryUser = thePrimaryUserID