This error occurs when the Single Sign-On provider does not include the relayState in its response to the return URL. Because the relayState is missing, the extension cannot read the expected sp_entity_id, which leads to the “Undefined array key sp_entity_id” message.
To resolve this issue, make sure your SSO provider is configured to always return the relayState parameter in its authentication response. Once the IdP passes the relayState correctly, the sp_entity_id can be read and the error will be resolved.