Creates an instance of AuthManager.
The target iframe element to manage.
OptionaluserId: stringThe user ID to authenticate with.
OptionalapiKey: stringThe API key to authenticate with.
Cleans up all registered message event listeners previously added by _listenForMessage.
Call this method when the instance is being destroyed or no longer needs to listen to messages.
Initializes the AuthManager by:
A promise that resolves when the authentication response is received.
Handles authentication messaging between the parent window and an embedded iframe. Sends user credentials to the iframe and listens for an authentication response.