내가 개발 한 API를 등록하기 위해 Azure를 사용한 후 SCP 클레임에 관한 질문이 있습니다. 필자는 다양한 자습서와 샘플 응용 프로그램을 따랐습니다. 모든 것이 제대로 확인하고 나는 주로이 튜토리얼을 사용하여 신뢰할 수있는 서브 시스템에서 API 메서드를 호출 할 수있어 : https://github.com/AzureADSamples/WebApp-WebAPI-OAuth2-AppIdentity-DotNetAzure API 관리 - 범위 요청 NULL
나는 SCP 주장의 유효성을 검사 할 때 나는 데 문제가 있습니다 :
Claim scopeClaim = ClaimsPrincipal.Current.FindFirst("http://schemas.microsoft.com/identity/claims/scope");
을
scopeClaim 값은 항상 null입니다. ClaimsPrincipal 내의 클레임을 보았습니다. 현재 오브젝트가 있지만 범위는 아닙니다. 필자가 매니페스트를 다운로드하고 응용 프로그램 권한을 포함하여 업로드 한 경우 호출 응용 프로그램에 올바른 범위가 있는지 확인하기 위해 API 내에서 사용할 수 있습니다. 더 다양한 선택 클라이언트 웹 응용 프로그램을 장난과 API에 대해 여러 appPermissions을 만들고 수에 따라서 ...
"appPermissions": [
{
"claimValue": "access.fullaccess",
"description": "Allow the application full access to the service on behalf of the signed-in user",
"directAccessGrantTypes": [],
"displayName": "Have full access to the service",
"impersonationAccessGrantTypes": [
{
"impersonated": "User",
"impersonator": "Application"
}
],
"isDisabled": false,
"origin": "Application",
"permissionId": "52966341-1bb5-4e9f-b4f6-46aad4d03b33",
"resourceScopeType": "Personal",
"userConsentDescription": "Allow the application full access to the service on your behalf",
"userConsentDisplayName": "Have full access to the service"
}
]
가 사전에 감사
폴
: 다음은 내 응용 프로그램 매니페스트 (만 appPermissions)입니다 반환 된 JWT의 "범위"에는 범위 청구가 포함되지 않습니다. 내가 누락되었거나 제대로하지 못하는 것이 있습니까? 어떤 도움을 주시면 감사하겠습니다.
Logic 앱이 API를 사용하는 경우 가능합니다. 현재 우리가 읽은 모든 문서는 도움이되지 못했습니다. – M0rty