Microsoft Web Addins “Office.context.mailbox.getCallbackTokenAsync” returns response “Failed” on my Exchange 2016 but works in office 365 online

ぐ巨炮叔叔 提交于 2019-12-23 04:40:43

问题


We have exchange 2016 sever which we have updated to CU-12 recently because we thought it might be the sever update thing, but now it seems it don't works with update too

I am simply using Rest API with the help of passing token to get some fields from the current mail using Addin.

But It throws an response "failed" every time when the function "Office.context.mailbox.getCallbackTokenAsync" is called.

Code:

 1 Office.context.mailbox.getCallbackTokenAsync({isRest: true, "asyncContext" : this.__archiveComponent}, function(result){
 2 if (result.status === "succeeded") {
 3    let accessToken = result.value;
 4    result.asyncContext.getMultiValueExtendedProperty(accessToken,data[0]);
 5 } else {
 6     var err = result.name;
 7     console.log(err.name + ": " + err.message);
 8   }
 9 });

Error:in browser console the JSON response in details is:

{"Header":{"ServerVersionInfo":{"MajorVersion":15,
"MinorVersion":1,
"MajorBuildNumber":1713,
"MinorBuildNumber":5,
"Version":"V2017_07_11"
}},

"Body":{"ResponseMessages":{
"Items":[{"__type":"GetClientAccessTokenResponseMessage:#Exchange",
"MessageText":"The token for this extension could not be retrieved.",
"ResponseCode":"ErrorInvalidClientAccessTokenRequest",
"ResponseClass":"Error",
"Token":null}]
}}}

Note: This works fine in Office 365 online . I deployed the same on a OnPrem server Exchange 2016 CU-12 update.

Hope should get some detailed explanation if anyone has fixed the same. I feel that there must be some configuration ,but need a guidance.

Some doubts which i have is

  1. Does Rest Api only works with office online and not on OnPrem exchange server?

  2. Or is it compulsory to have exchange online to get this work with onPrem Exchange server using HYBRID?

If Yes then if we build an addin with rest API and customer dont have office online what would be the way to get this work on customer onPrem exchange server.

More Info: I also See the similar question like this Similar question but there is no relevant answer or suggession i see which clears my above questions.


回答1:


Based on the comments above, if you are hitting the Missing Signing Certificate issue, it could be because the Admin Server never created a new one. These steps may solve the issue.

1) Create new self-signed certificate using New-ExchangeCertificate cmdlet

2) Modify the authorization configuration using Set-AuthConfig cmdlet to set thumbprint and publish the certificate created in step #1



来源:https://stackoverflow.com/questions/56061449/microsoft-web-addins-office-context-mailbox-getcallbacktokenasync-returns-resp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!