Comments (14)
@Zlatkovsky, Agreed on the naming. I'll introduce the new signature in 0.8.0 and deprecate the current signature after 2 - 3 releases.
As for the flow itself, I don't see what you hope to accomplish with isAuthDialog=true
? The dialog closes successfully today and there seems to be some error post that which will debug. Also there's no messaging back happening when its in only Web mode in IE 11. When isAuthDialog
detects web mode, it just decides to create a new popup and constantly poll the popup till its back on the same domain.
from office-js-helpers.
@Zlatkovsky After thinking this through more carefully, I realize the current name is the best possible name that I can provide. But before I discuss that, the error that you are facing isn't related to messageParent
and the host detection is working fine. Its an IE11 issue that I am trying to work around and will fix it soon.
As for the name itself. The idea behind the name is as follows:
if(Authenticator.isAuthDialog()) {
// Then we know for sure that this code is running inside of a dialog (irrespective of an Office dialog, teams dialog or web popup)
// Allow the developer to run the custom code here or completely stop execution
}
// This code will only be run inside of the main Add-in unless the developer hasn't stopped execution inside of a dialog. If so then both pieces of code will be run.
from office-js-helpers.
Bhargav, I agree that as single call that both dispatches and returns a result, it's hard to make that API name better. But what if you have something like this:
let initializeResult = Authenticator.initializeIfRelevant();
if (initializeResult.isAuthDialog) {
// ...
return;
}
Which of course can be simplified to
if (Authenticator.initializeIfRelevant().isAuthDialog) {
// ...
return;
}
And you can probably come up with a better name for initializeIfRelevant
(including just initialize()
), though I think the "is relevant" piece is also important to convey.
What do you think about that?
from office-js-helpers.
@Zlatkovsky Would you like to test out https://unpkg.com/@microsoft/[email protected]/dist/office.helpers.js. This addresses all the authentication issues faced in IE11
from office-js-helpers.
ping @Zlatkovsky
from office-js-helpers.
@WrathOfZombies , I tried integrating "0.8.0-beta.4" into Script Lab just now. I can't speak to the authentication issues, but it does break a bunch of other stuff (editor doesn't fully load; get an "Unable to get property 'lastUpdatedText' of undefined or null reference, which is coming out of Script Lab code, but is presumably being caused by some change in the Office.js helpers).
I haven't had a chance to debug it, but when I rolled back to 0.7.4 things were good again, and when I rolled forward to 0.8.0-beta.4, things were broken again. You can try it yourself simply by checking out the latest version of Script Lab, master branch (or others...) and first seeing that the site works in IE in the old version, and then fails with the new OfficeJsHelpers version.
(BTW, it fails in chrome as well, without a console error, but with same effect of the site becoming non-usable; perhaps it's some observable is breaking, and the buttons no longer respond after that).
from office-js-helpers.
BTW, is there a way (a tag?) by which I could view the diff between 0.8.0-beta.4 and 0.7.4?
from office-js-helpers.
Here's the delta but its quite large as there have been many changes from 0.7 to 0.8...
master...bhkrish/revamped-dialog-flow
from office-js-helpers.
Still seeing the problem that the Dialog won't close correctly in IE11 with 0.8.0-beta.4.
It seems to lie in that even though I'm running IE11, Utilities.isAddin()
still returns true in Dialog.close().
from office-js-helpers.
So in the beta, the dialog problem with IE11 is solved by using localStorage
. I have an interval tick to check if a particular unique localStorage item has been set and if so extract it and get the value from there. When running the beta and launching the dialog, after the redirection is complete, please check if the localStorage contains this key: VGVtcG9yYXJ5S2V5Rm9yT0pIQXV0aA==
?
Also with respect to the lie, can you tell me the value of Utilities.host
& Utilities.platform
as that would help debug further?
from office-js-helpers.
Yeah, I found the reference to that key in the code while debugging. The value of the key is never set because of this codeblock
Just flip the else-if statement? :)
For the Utilities.host
it returns OUTLOOK
, while Utilities.platform
returns OFFICE_ONLINE
.
from office-js-helpers.
Then that is expected. As we want to use Outlook's Add-in dialog. I'll take a look at the bug that the add-in doesn't close in IE11.
Seems that for IE11 specifically, I need to do some sort of URL redirection within the dialog to make it work.
from office-js-helpers.
Please try the latest version and let me know if you are still seeing issues. @ChobiJava
from office-js-helpers.
The code seem to execute correctly @WrathOfZombies , but unfortunately as stated in this new issue the configuration for the endpoint is returned rather than the actual token.
from office-js-helpers.
Related Issues (20)
- Google auth dialog showing "403 diallowed_useragent" HOT 1
- `plus.me` scope does not return email of user HOT 2
- OfficeHelpers.UI.notify has no background color in a React-based Office Add-in HOT 1
- office-js-helper with IdentityServer? HOT 1
- Double clicking the 'Allow' button on the dialog consent form in Word Online launches two dialogs HOT 1
- Office helpers gives undefined exception on Word 2016 HOT 3
- Storage.has(key) returns true even when the key actually doesn't exist.
- Missing any login dialog
- redirectUrl problem HOT 1
- Edge authentication popup doesn't close HOT 1
- IsAddin check fails in Browser, still returns true and uses Dialog framework HOT 3
- Authentication dialog not closing in Office Online on IE11(11.706.17134.0)
- Unable to delete 'AzureAD' from storage HOT 1
- redirect and automatically closing authentication dialog and token issue (MAC safari)
- Office Addin for Powerpoint : Dialog & authentication issue.
- Office Version 1907 / Windows 1903 - Authentication Redirect HOT 4
- feature request: Store token in OfficeRuntime.Storage HOT 1
- Authenticator: Make width and height of dialog window configurable
- State couldn't be verified
- displayDialogAsync does work in vanilla js but doesn't with react HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from office-js-helpers.