问题
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
Does Rest Api only works with office online and not on OnPrem exchange server?
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