-
Notifications
You must be signed in to change notification settings - Fork 24
not working in mobile outlook app #6
Description
have developed an Outlook web add-in which can be used in Outlook native client, mobile app and outlook web to upload files to SharePoint online document library.
1. In the add-in, JavaScript calls a new Office.js API getAccessTokenAsync. This tells the Office host application to obtain an access token to the add-in. (Hereafter, this is called the access token because it is replaced with a second token later in the process.For an example of a decoded bootstrap access token.
2. If the user is not signed in, the Office host application opens a pop-up window for the user to sign in.
3. If this is the first time the current user has used your add-in, he or she is prompted to consent.
4. The Office host application requests the access token from the Azure AD v2.0 endpoint for the current user.
5. Azure AD sends the bootstrap token to the Office host application.
6. The Office host application sends the access token to the add-in as part of the result object returned by the getAccessTokenAsync call.
7. JavaScript in the add-in makes an HTTP request to a web API that is hosted at the same fully-qualified domain as the add-in, and it includes the access token as authorization proof.
8. Server-side code validates the incoming access token.
9. Server-side code uses the “on behalf of” flow to obtain an access token.
10. Azure AD returns the access token to the add-in.
11. Server-side code caches the access token.
12. Server-side code makes requests to exchange server to get attachment and upload attachment into SharePoint.
13. SharePoint REST API returns data to the add-in, which can pass it on to the add-in’s UI.
14. When the access token expires, the server-side code can use its refresh token to get a new access token.
This add-in is working in desktop and web outlook but is failing inconsistently in mobile devices using native outlook app.
In mobile device: it is working randomly for some accounts whereas the same code is not working for other accounts irrespective of the device.
We have verified for outlook versions, devices, account permissions level and do not see any issues.
While debugging we suspected that the problem might be processing documents from EWS server. In mobile outlook app the attachment token and ID values are different from desktop/web client for the same code.
Code links –
https://docs.microsoft.com/en-us/outlook/add-ins/get-attachments-of-an-outlook-item
We are receiving the error in below snippet of code that is referenced from the above mentioned links.
ExchangeService service = new ExchangeService();
service.Credentials = new OAuthCredentials(request.attachmentToken);
service.Url = new Uri(request.ewsUrl);
var getAttachmentsResponse = exchangeService.GetAttachments(attachmentIds.ToArray(),
null,
new PropertySet(BasePropertySet.FirstClassProperties,
ItemSchema.MimeContent));
getAttachmentsResponse.OverallResult returning ERROR in mobile for particular users
Need help to resolve this issue
Thanks & Regards
Girish Kumar MS
girish.ccc@gmail.com