-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Outlook Add-in with ADAL consistently fails #154
Comments
Created a repro repository and a branch with the trivial work around |
I was having a discussion with @richdizz that we may pull out ADAL.js usage in Office add-ins as this really doesn't work in production scenarios and there are better patterns to use. Such as that shown in the Clause Library code sample that use sockets via signalR. There is a node sample too that shows this and a document on MSDN also https://msdn.microsoft.com/en-us/library/office/mt629180.aspx So I think the Issue is to actually remove ADAL.js from the generator. @waldekmastykarz what are your thoughts here? |
It would be great to have an implementation that works everywhere every time, so if there is a better pattern than what we have in the generator now, let's replace it 😄 |
Nine months have now gone by on this issue. Are there thoughts out there as to the approach that should be taken by developers to make their apps work from the generated add-in? Is dropping ADAL really the answer? |
@jthake , can you please elaborate on why "ADAL.js usage in Office add-ins as this really doesn't work in production scenarios and there are better patterns to use"? @richdizz , could you please also weigh in on this also? I mean, ADAL.js seem to work perfectly fine in an office add-in, (I am yet to use in production add-in though, but I use it in generic production web apps), and its allot simpler to work with than than nice and fancy but 'complicated' add-in solution using SignalR and storing access_token and refresh_token in database. I am referencing this sample here https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/Outlook.ConsumeGraphAPI which is not that old, "last commit Sept 6 2016" and it seems to work just fine. Is there something wrong with this? I'm just trying to understand the reasoning on this. @richdizz , just FYI I have looked at your blogs, read your articles on this subject, looked at your samples etc, and thanks very much for providing all of this useful info. But it does not clarify to me why I would choose it over adal.js. |
@jthake , Any progress with support of ADAL within Outlook add-in ? @nigel-dewar , Is your office add-in still working with ADAL ? |
i mate i gave up on adal.js in general as just doesnt seem to be much interest in supporting it. i ended up referencing this project https://github.com/OfficeDev/PnP-OfficeAddins/tree/master/Samples/Outlook.MailCRM/DXDemos.Office365 which seems to be best option. This one you have your user sign in using openidconnect and store the users token in the tokencache server side. The project provides a key back to the addin. It seems to work pretty well. I didnt want to go dowb this road as i do find adal.js quite simple, but this sample does work and means your users will not need to sign in very often. All the token refresh will happen server side. let me know if this works foe u. If you get stuff and need to use adal then let me know and ill try help out. Nige. |
@gavinbarron Kindly explain the work around you used here https://github.com/gavinbarron/Outlook-ADAL-Issue/tree/work-around |
I realize that this might not be the appropriate place to raise this issue, happy to have it closed and open it elsewhere. Really want to get it out so that the right people can see the issue,
When using the generated code for an Outlook Add-In using ADAL the app crashes due to an error in the ADAL IFrame after-redirection back to the app.
The outlook-web-16.01.js script throws an errorSys.ArgumentNullException: Sys.ArgumentNullException: Value cannot be null. Parameter name: conversationId
Under the recommended approach this happens before the angular app has had a chance to bootstrap and causes the app to stop at this point.
Utilizing an ng-app directive to automate the bootstrap and moving the Office Initialize call inside the home controller allows the angular app to start in the IFrame and gather the ADAL access token thus allowing the main window to continue as it now has credentials to make ADAL secured calls.
This has also been noted on SO: http://stackoverflow.com/questions/35358911/first-time-loading-outlook-web-add-in-error-on-console
Happy to create a trivial re-pro if that's helpful
The text was updated successfully, but these errors were encountered: