2014-09-29 3 views
0

Dynamics CRM 2013 플러그인에서 Sharepoint 2013 인증을 하나의 Office 365 환경에서 모두 수행하려고합니다. 궁극적으로 Dynamics CRM에서 Sharepoint로 이메일 첨부 파일을 복사하려고합니다 (Post Email Attachment Create Async). 지금까지이 여행은 장애로 가득 차있었습니다.Office 365 : Dynamics CRM 플러그인과 Sharepoint간에 인증

  • 나는 클라이언트 ID와 비밀을 얻기 위해 AppRegNew.aspx에 갔다.
  • 웹 요청을 작성하여 mycompanyname.sharepoint.com/_layouts/15/OAuthAuthorize.aspx에 정보를 게시했지만 403 금지 된 오류가 표시됩니다. 나는 동성 CRM 온라인에 Sharepoint.Client.dll을 배포 할 수 없습니다이기 때문에
  • 나는 CSOM을 사용할 수 없습니다
  • 내가 요청 PARAMATERS의 범위는 다음

해야 모르겠어요

string clientId = "myclientid"; 
string clientSecret = "asecretstring"; 

this.request = string.Format("grant_type=client_credentials&client_id={0}&client_secret={1}&scope=list.read", Uri.EscapeDataString(clientId), Uri.EscapeDataString(clientSecret)); 

WebRequest webRequest = WebRequest.Create(OAuthUri); 
webRequest.ContentType = "application/x-www-form-urlencoded"; 
webRequest.Method = "POST"; 
byte[] bytes = Encoding.ASCII.GetBytes(this.request); 
webRequest.ContentLength = bytes.Length; 
using (Stream outputStream = webRequest.GetRequestStream()) 
{ 
    outputStream.Write(bytes, 0, bytes.Length); 
} 
using (WebResponse webResponse = webRequest.GetResponse()) 
{ 
    // get token from the response 
} 

나는 두 개의 오피스 365 시스템 사이 를 인증하는 몇 가지 방향을 주셔서 감사합니다 정말 것이다 : 나는 지금까지 무엇을에서 코드 발췌입니다.

답변

0

요청에 따라 "Mozilla/5.0 (호환 가능, MSIE 9.0, Windows NT 6.1, WOW64, Trident/5.0)"과 같은 UserAgent 문자열을 설정해야합니다.