Microsoft Graph API에서 캘린더를 가져 오기 위해 호출 할 때 권한이 없으므로이 확인을 사용하여 액세스 토큰을 검색합니다.office365 그룹의 캘린더에 액세스 할 수 없습니다.
캘린더에서 HTTP 요청 가져 오기를 검색 할 때 인증 토큰이 인증되지 않은 호출의 결과로 생성되지 않는다고 생각합니다. 자격증 명을 보내고 더 많은 권한을 가진 더 우수한 토큰을 얻을 수 있도록 코드를 어떻게 변경합니까?
Azure 포털에서 응용 프로그램 권한이 올바르게 설정되지 않았는지 확인하기 위해 모든 권한을 부여했습니다.
AuthenticationContext authenticationContext = new AuthenticationContext(authString, false);
ClientCredential clientCred = new ClientCredential(_azureAd_ClientId, _azureAd_SecretKey);
string tokenResult;
AuthenticationResult authenticationResult;
try
{
authenticationResult = await authenticationContext.AcquireTokenAsync(_azureAd_GraphResource, clientCred);
var user = authenticationResult.UserInfo;
string_token = authenticationResult.AccessToken;
tokenResult = JsonConvert.SerializeObject(authenticationResult);
}
catch (Exception ex)
{
throw new Exception(ex.Message, ex.InnerException);
}
'_azureAd_GraphResource'의 값은'https : // graph.microsoft.com'입니까? – juunas
예, 끝 슬래시가 "https://graph.microsoft.com/" –
예. 좋습니다. 앱 권한을 추가 했습니까? 클라이언트 자격 증명을 사용 중이므로 위임 된 권한은 여기에 적용되지 않습니다. 또한 해당 권한을 부여해야합니다. 포털의 권한 부여 버튼을 누릅니다. – juunas