Muthu Palaniappan, Unfortunately, there isn't a direct way to check the state of the authentication popup. However, you can implement a workaround by managing the state within your application. For example, you can set a flag when the popup is opened and reset it when the popup is closed. This way, you can prevent opening a new popup if the flag indicates that one is already open.
Before opening a new popup, check the isPopupOpen
state. If it's true
, prevent the new popup from being opened.
If you encounter the error "There was a problem reaching this app" when using dialog.url.open
, ensure that the URL you are trying to open is listed in the validDomains
section of your app's manifest. This is crucial for the popup to work correctly in Teams.
also, make sure that your authentication flow starts and ends on a page that is on your domain. The authenticate()
method should open a popup on your domain, redirect to the identity provider, and then call notifySuccess()
or notifyFailure()
as appropriate.
Reference Document-