You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
I am currently doing an outlook add in using office-js-helpers to get token for calling Graph API. I also following some instructions found on issues resolution here to setup redirect url is https://localhost:3000/taskpane.html in app registration in azure portal and also in the code:
I also put the check for closing the dialog inside Office.Initialize
I tested in the web application that can login to by outlook.office.com
Here are some issues I found:
When using version 1.0.2, the add in ask to open the dialog for authentication as expected, and it redirect to my url setting up above and attached to that url is access_token (what I can use to call Graph API successfully). But then the dialog does not close automatically (I check the script and it console out the message I put there):
if (OfficeHelpers.Authenticator.isAuthDialog()) {
// Adding code here isn"t guaranteed to run as we need to close the dialog
console.log("inside")
console.log(OfficeHelpers.Authenticator.getUrlParams())
return;
}
When I switch the library version to 1.0.0 and run the flow again, it did return the result for me (it reached "then" statement in the code above), but inside that result, I cannot find any token that can be used (here is what I got from console.log):
[Log] {"clientId":"my client id","baseUrl":"https://login.microsoftonline.com/common/oauth2/v2.0","authorizeUrl":"/authorize","responseType":"token","scope":"https://graph.microsoft.com/user.read","extraQueryParameters":{"response_mode":"fragment"},"nonce":true,"state":true,"redirectUrl":"https://localhost:3000/taskpane.html","provider":"Microsoft"} (taskpane.js, line 9731)
I then set force re-authentication, the behavior happens as described in 1.
Please let me know if the issues I found is duplicated somewhere and feel free to close or let me know if I can help close this.
PS: I am new to develop a web add-in like this. So it would be great if I have your suggestion on this :) : Is this a best practice to have the add in get token then call its backend (writing in node or asp.net api) to validate and call rest API there and return result to the add in OR the add in can do everything itself ? (I have successfully try Office js getCallbackTokenAsync and use the token to call Outlook REST API directly in the add in code, but I wonder in case the mailbox version does not support that getCallbackTokenAsync as ver 1.4, what will I do as a replacement? ). My add in just do some simple jobs like reading email, send email with attachment and moving email to folder in mailBox.
Thank you very much,
Vinh
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
I am currently doing an outlook add in using office-js-helpers to get token for calling Graph API. I also following some instructions found on issues resolution here to setup redirect url is https://localhost:3000/taskpane.html in app registration in azure portal and also in the code:
I also put the check for closing the dialog inside Office.Initialize
I tested in the web application that can login to by outlook.office.com
Here are some issues I found:
Here is from the console.log
When I tried closing this manually, I got error with dialog show out in the console and there is nothing return
I then set force re-authentication, the behavior happens as described in 1.
Please let me know if the issues I found is duplicated somewhere and feel free to close or let me know if I can help close this.
PS: I am new to develop a web add-in like this. So it would be great if I have your suggestion on this :) : Is this a best practice to have the add in get token then call its backend (writing in node or asp.net api) to validate and call rest API there and return result to the add in OR the add in can do everything itself ? (I have successfully try Office js getCallbackTokenAsync and use the token to call Outlook REST API directly in the add in code, but I wonder in case the mailbox version does not support that getCallbackTokenAsync as ver 1.4, what will I do as a replacement? ). My add in just do some simple jobs like reading email, send email with attachment and moving email to folder in mailBox.
Thank you very much,
Vinh
The text was updated successfully, but these errors were encountered: