OfficeDev / office-js-helpers

[ARCHIVED] A collection of helpers to simplify development of Office Add-ins & Microsoft Teams Tabs
MIT License
126 stars 56 forks source link

Need help with authenticator(Popup is not closing) #55

Closed m1chaeldg closed 6 years ago

m1chaeldg commented 6 years ago

Hi,

So far I followed all the steps on how to setup this. Like adding the IDP/SSO in app domain list in the manifest file. Setting the Requirement set MinVersion to 1.4 of Mailbox. Using https and trusted cert.

The authentication popup is working and redirecting to our SSO eg google and custom SSO (Identity Server 4). The user can login but when it comes to close or send a message from popup dialog to the parent windows it always says :

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://outlook.office.com') does not match the recipient window's origin ('https://localhost:3000'). invoke @ outlook-web-16.01.js:9

Btw, the popup or the invoke of authenticate was fired from the web outlook addin.

Any idea or tips on how to solve this?

Thanks Mike

WrathOfZombies commented 6 years ago

@m1chaeldg Thanks for reporting this. Yes I am aware of an issue with outlook and I am trying to find solutions that work for everybody. Can you try using this beta of OfficeHelpers and tell me if the issue is resolved for you?

https://unpkg.com/@microsoft/office-js-helpers@0.8.0-beta.4/dist/office.helpers.js

m1chaeldg commented 6 years ago

Thanks. I will try and update you the result

alx-andru commented 6 years ago

I'm actually seeing the same issue with https://accounts.google.com

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://accounts.google.com') does not match the recipient window's origin ('https://localhost:44323')

Any ideas or hints?

WrathOfZombies commented 6 years ago

Just pushed an update to solve dialog issues in IE11 & Edge. Please try the latest version

m1chaeldg commented 6 years ago

@alx-andru , try to look at your manifest file. Make sure the AppDomain's value is correct. It will point to your localhost or target domain where you deploy the addin and the port and no slash at the end. https://localhost:444/ is not equal to https://localhost:444. sample value of app domain

`

https://localhost:444

`

GopalZadafiya commented 5 years ago

@WrathOfZombies I am facing the same issue with Outlook Native application in Windows.

NeerajTanwar commented 4 years ago

@WrathOfZombies Hello Bhargav, I am having the same Issue. Pop up window opens and then its does not get close. If I close manually then there is no way to get the token back. its giving me Right token after some work around. but pop up does not close. Can you please let me what is the fix for this. Truly appreciated in advance.

NeerajTanwar commented 4 years ago

authenticator .authenticate(OfficeHelpers.DefaultEndpoints.Microsoft,true) .then(function (token) {

  console.log("My Most Awaited Token Lol",token) 
})
 .catch(OfficeHelpers.Utilities.log);