Microsoft의 분산 문서에 약간 혼란 스럽습니다.Keyvault 인증 (REST API)
가 나는 것을 의미하는 응용 프로그램 (https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal)를 만든 지금이 :
- 응용 프로그램 ID
- 키
- 디렉토리 ID는
나는 푸른에서 KeyVault에 갔다 포털 및 응용 프로그램에 대한 사용 권한을 부여했습니다.
테스트 목적으로 CURL을 통해 테스트를 실행하려고합니다.
curl -d "grant_type=client_credentials&client_id=<removed_for_security>&client_secret=<removed_for_security>" https://login.microsoftonline.com/<removed_for_security>/oauth2/token
이 토큰을 반환 :이를 위해 사용하고 기초는 다음 Microsoft 페이지 (https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-service-to-service#request-an-access-token 및 https://docs.microsoft.com/en-us/rest/api/#create-the-request)
그래서, 내가 할 첫 번째 일은 다음 호출을 통해 토큰을 얻을이다.
curl -H "Authorization: Bearer <removed_for_security>” -vv https://<removed_for_security>.vault.azure.net/secrets/<removed_for_security>/<removed_for_security>
난 그냥 "HTTP/1.1 401 권한"
그래. API 버전을 잊어 버렸습니다. –
이상한, API 버전을 제거했을 때 API 버전을 지정하는 것을 잊어 버렸다고 구체적으로 말한 적이 있습니다 ... @LittleCode – 4c74356b41