2014-04-14 2 views
0

새로운 Office 365 API를 활용하기위한 시도를 시작했습니다. 그래도 문제가 발생합니다.새로운 Office365 API를 통한 인증

access_token을 성공적으로 가져 왔지만 문서가 그걸로 무엇을해야하는지 알려주지 않습니다.

다른 사람이이 작업을 성공적으로 완료 했습니까? 아니면 설명서를 빨리 ​​읽었습니까?

감사

편집 : - (9을 찾아주세요) http://msdn.microsoft.com/en-us/library/office/dn605896.aspx

답변

1

액세스 토큰이 embedded in the request when calls the resource해야 링크를 잊으. 그래서 예를 들어, 당신이 당신의 요청 헤더에 액세스 토큰을 제공해야 같은데요 :

context.SendingRequest2 += (s, e) => { e.RequestMessage.SetHeader("Authorization", "Bearer " + accessToken); };

1

문서 내 연구가 거의 inexistent하지만에 따라 PHP와 마이크로 소프트 오피스 365의 API를 사용하는 ... 내가했다

http://www.phpclasses.org/package/7700-PHP-Authorize-and-access-APIs-using-OAuth.html

는 희망이 도움이 다음의 OAuth 연결을 처리하기 위해 PHP 클래스를 사용하여 Office API를 사용할 수!

// Oauth to Office365 
$office_oauth = new oauth_client_class; 
$office_oauth->debug = true; 
$office_oauth->debug_http = false; 

$office_oauth->redirect_uri = 'http://' . $_SERVER['HTTP_HOST']; 

$office_oauth->client_id = 'YOUR_CLIENT_ID'; 
$office_oauth->client_secret = 'YOUR_CLIENT_SECRET'; 

$office_oauth->dialog_url = 'https://login.windows.net/common/oauth2/authorize?response_type=code&client_id={CLIENT_ID}&redirect_uri={REDIRECT_URI}&state={STATE}&scope={SCOPE}&resource='.UrlEncode("https://outlook.office365.com/"); 
$office_oauth->access_token_url = 'https://login.windows.net/common/oauth2/token'; 

$office_oauth->oauth_version = 2; 
$office_oauth->url_parameters = 1; 
$office_oauth->authorization_header = 1; 
$office_oauth->exit = 0; 

$office_oauth->scope = 'YOUR_SCOPES'; 

if (($officeSuccess = $office_oauth->Initialize())) { 

    $officeSuccess = $office_oauth->Process(); 
    $officeSuccess = $office_oauth->Finalize($officeSuccess); 
} 

if ($office_oauth->exit) { 
    exit; 
} 
:

이 같은 액세스 할 수 있습니다이 클래스를 사용하여