3

Office 365는 응답 헤더에서 X-BackendOverrideCookie를 반환하지 않습니다.Office 365 EWS가 X-BackendOverrideCookie를 반환하지 않음

X-AnchorMailbox 및 X-PreferServerAffinity를 요청 헤더에 올바르게 설정했습니다. 이것은 MSDN에서 말한 것처럼 X-BackendOverrideCookie를 반환하지 않습니다. 왜 이런 일이 일어나는 걸까요?

한편 X-AnchorMailbox 및 X-PreferServerAffinity도 설정하지 않았고 각 응답에서 X-BackendOverrideCookie를 반환합니다. 이것은 풀 및 푸시 알림 그룹에 대한 선호도를 관리해야하므로 좋지 않습니다. 원하는 경우이 쿠키를 설정해야하며 기본적으로 항상 설정하지 않아야합니다.

편집 1 :

흐름은 다음과 같이 간다. JS를 사용하여 구독 요청을 보내고 있습니다. 그 목적을 위해 나는 SOAP 형식으로 나의 요청을 포장하기 위해 lather을 사용한다.

작동이 어떻게 보이는지 이것은이 요청을 형성하고 송출 실행하면

var impersonate = ‘[email protected]’ 

var subscribe = { 
     "m:Subscribe": { 
        "m:PullSubscriptionRequest": { 
         "t:FolderIds": { 
          "t:DistinguishedFolderId": { 
           attributes: [{ 
            'Id': this.distinguishedFolderId 
           }] 
          } 
         }, 
         "t:EventTypes": [{ 
          "t:EventType": "CreatedEvent" 
         }, { 
          "t:EventType": "DeletedEvent" 
         }, { 
          "t:EventType": "ModifiedEvent" 
         }], 
         "t:Timeout": "10" 
        } 
       } 
    }; 


soapHeader = { 
       “t:ExchangeImpersonation": { 
        "t:ConnectingSID": { 
         't:SmtpAddress': impersonate 
        } 
       } 
      } 

lather.up({ 
       body : requestName,   
       headers : { 
        Authorization : lather.basicAuth(this.username, this.password),    
        'X-AnchorMailbox': impersonate, 
        'X-PreferServerAffinity': true 
       }, 
       additionalNamespaces : [ 
        'xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"', 
        'xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"', 
       ], 
       soapHeader : soapHeader, 
       method : 'POST', 
       url : ‘https://outlook.office365.com/EWS/Exchange.asmx', 
      }, function(error, res, body) { 
       // Process the response 
      }) 

. 나가는 원시 요청을 보았을 때 헤더가 제 위치에 있음을 확인합니다.

headers: 
{ Authorization: 'Basic c29m…’, (shortened just in case) 
'X-AnchorMailbox': ‘[email protected]', (fake mail) 
'X-PreferServerAffinity': true, 
'Content-Length': 971, 
'Content-Type': 'text/xml; charset=utf-8', 
host: 'outlook.office365.com' } 

그런 다음 Office에서 다음과 같은 응답을 받았습니다.

응답의 본문 : (만약을 단축 IDS) 응답의

<?xml version="1.0" encoding="utf-8"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="693" MinorBuildNumber="12" Version="V2016_10_10" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/></s:Header><s:Body><m:SubscribeResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><m:ResponseMessages><m:SubscribeResponseMessage ResponseClass=“Success”><m:ResponseCode>NoError</m:ResponseCode><m:SubscriptionId>KQB2aTFwcjA…wucsA==</m:SubscriptionId><m:Watermark>AQAAAFQ+2wmbaZF…JAAAAAAA=</m:Watermark></m:SubscribeResponseMessage></m:ResponseMessages></m:SubscribeResponse></s:Body></s:Envelope> 

헤더는 다음과 같습니다 (단축 IDS, 쿠키)

{ 'cache-control': 'private', 
'transfer-encoding': 'chunked', 
'content-type': 'text/xml; charset=utf-8', 
server: 'Microsoft-IIS/8.5', 
'request-id': ‘2881ab3…1ec461’, 
'x-calculatedbetarget': 'VI1PR0501MB2096.eurprd05.prod.outlook.com', 
'x-backendhttpstatus': '200', 
'set-cookie': [ ‘exchangecookie=d8f8…1e8; expires=Sat, 28-Oct-2017 08:41:27 GMT; path=/; HttpOnly' ], 
'x-ewshandler': 'Subscribe', 
'x-aspnet-version': '4.0.30319', 
'x-diaginfo': 'VI1PR0501MB2096', 
'x-beserver': 'VI1PR0501MB2096', 
'x-powered-by': 'ASP.NET', 
'x-feserver': 'VI1PR0901CA0093', 
date: 'Fri, 28 Oct 2016 08:41:26 GMT' } 

당신은 내가 볼 수 있듯이 교환 쿠키 만 받고 X-BackendOverrideCookie는 없습니다. 무슨 일이 일어나고 있는지에 대한 아이디어가 있습니까? 내가 뭔가 잘못하고 있는거야?

편집 2 : 나는 또한 EWSEditor와 함께이 시도

. 두 개의 헤더를 설정하고 끌어 오기 구독 요청을했습니다. 나는 여기와 같은 결과를 얻는다.

편집 3 : 여기

은 SOAP 헤더를 포함하지 않는 전체 request

+0

이것은 나와 다른 사람들에게 올바르게 작동하므로 코드에 문제가있을 가능성이 높으므로 사용중인 것을 게시해야합니다. –

+0

관리되는 API의 JS 포트 인 ews-javascript-api를 사용하고 있습니다. 하지만 이제는 원시 이메일 요청을 보내려고 시도하고 헤더를 추가했으며 사무실의 응답에는 교환 쿠키, 백엔드 대체 쿠키가 포함되지 않았습니다. 이것은 그것이 얻는만큼 간단하다, 나는 내가 잘못하고있는 것을 볼 수 없다. 이 백엔드 재정의 쿠키를 설정하기위한 Office 설정이 있습니까? – eomeroff

+0

아니요. 원시 요청을 헤더 (헤더 포함)에 게시 할 것을 제안합니다. 헤더를 포함하여 요청을 게시하는 것이 좋습니다. 단호한 방법을 보여주지 않으면 누군가가 잘못했는지 알려줄 수 있습니다. –

답변

0

귀하의 질문,하지만 당신은 내가 있던 같은 문제가 발생하는 경우, 다음 문제는 함께 해당 헤더의 RequestServerVersion 매개 변수

<soap:Header> 
    <t:RequestServerVersion Version="Exchange2013_SP1"/> 
</soap:Header> 

중요한 부분은 Exchange2013_SP1입니다 :

특히, 같은 것을 포함 할 것이다. _SP1이 없으면 Office365는 응답에 'X-BackendOverrideCookie'쿠키를 포함하지 않습니다.