2017-11-10 9 views
0

Azure AD B2C«MyApplication»이 생성되었습니다. AD의 B2C 애플리케이션«의에서는 MyApplication»의 모든 사용자가 읽기 요청을 우리는 다음과 같은 오류가 발생하는 경우 :Azure Active Directory B2C - 작업을 완료하는 데 필요한 권한이 충분하지 않습니다.

{ 
    "odata.error": { 
    "code": "Authorization_RequestDenied", 
    "message": { 
     "lang": "en", 
     "value": "Insufficient privileges to complete the operation." 
    } 
    } 
} 

허가를 들어, 전역 관리자 권한으로 로컬 계정을 사용 ([email protected]). HTTP 요청이 API를 그래프에 대한

나는 다음 URL을 사용 : "https://graph.windows.net/myapplication.onmicrosoft.com/users?api-version=1.6는"

는 AccessToken는 성공적으로 수신 및 요청 헤더에 추가되었습니다.

ASP.NET MVC 5 응용 프로그램 (4.5.2)

사용 라이브러리 :

  • Microsoft.Azure.ActiveDirectory.GraphClient 버전 = "2.1.1"
  • Microsoft.IdentityModel.Clients .ActiveDirectory "버전 ="3.17.1 "
  • Microsoft.IdentityModel.Logging"버전 = "1.1.4"
  • Microsoft.IdentityModel.Protocol.Extensions "버전 ="1.0.0 "
  • 012,351 6,
  • Microsoft.IdentityModel.Tokens "버전 ="5.1.4 "
  • Microsoft.Identity.Client"버전 = "1.1.0-미리보기"
  • Microsoft.Owin.Security.OpenIdConnect "버전 ="3.1.0 "

앱 등록 섹션 (추가 서비스 -> 보안 + 신원 -> 앱 등록)에는 b2c-extensions-app이라는 내장 응용 프로그램이 있습니다. 이 응용 프로그램을 사용하여 AD B2C 응용 프로그램에 액세스하려면 "필요한 사용 권한"을 변경해야합니까? "MyApplication" "AD B2C 사용자와의 CRUD 작업을 위해?

이 문제에 대한 또 다른 가장 정확한 해결책이 있습니까?

답변

1

본 안내서 참조 : Use the Azure AD Graph API: Get an access token.

사용자가 아닌 공유 암호를 통해 액세스 할 수 있습니다.

// The ClientCredential is where you pass in your client_id and client_secret, which are 
// provided to Azure AD in order to receive an access_token by using the app's identity. 
this.credential = new ClientCredential(clientId, clientSecret);