Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
986 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...