1

KeyVault 및 푸른 PowerShell에서 인증서 인증과 푸른 AD 응용 프로그램을 만들고 아래의 파워 쉘은이 니펫을 : 푸른 AD 응용 프로그램이 생성 된내가 푸른 PowerShell에서 인증서 인증과 푸른 광고에 응용 프로그램을 만들려고

Login-AzureRmAccount 

$certPassword = ConvertTo-SecureString $CertPassword -AsPlainText -Force 

$x509 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList  $certPath,$certPassword 

$credValue = [System.Convert]::ToBase64String($x509.GetRawCertData()) 

$adapp = New-AzureRmADApplication -DisplayName $ApplicationName -HomePage $URL -IdentifierUris $URL -CertValue $credValue -StartDate $startDate -EndDate $endDate  

$sp = New-AzureRmADServicePrincipal -ApplicationId $adapp.ApplicationId 

Set-AzureRmKeyVaultAccessPolicy -VaultName $VaultName -ServicePrincipalName $sp.ServicePrincipalNames[1] -PermissionsToKeys all –PermissionsToSecrets all -ResourceGroupName $ResourceGroupName 

"keyCredentials": [{ 
     "customKeyIdentifier": null, 
     "endDate": "2018-01-25T11:55:35.7680698Z", 
     "keyId": "ca1e536c-2220-478b-af73-1198d125bb5f", 
     "startDate": "2017-01-25T11:55:35.7680698Z", 
     "type": "AsymmetricX509Cert", 
     "usage": "Verify", 
     "value": null 
    } ] 
,691 : 성공적 그러나 인증서 인증의 customKeyIdentifier과 keyCredentials에서의 값 푸른 광고 응용 프로그램 생성 후 null의 경우, 이것은 내가 푸른 포털에서 다운로드 내 응용 프로그램의 매니페스트의 일부입니다

인증서는 로컬에서 생성 된 makecert 명령을 사용하여 만든 자체 서명 인증서입니다. 나는 작업 GetAccessToken (문자열 기관, 문자열 리소스, 문자열 범위) { VAR 비동기

공공 정적 애플리케이션 식별 & 지문과 토큰을 검색하기 위해 2.0.1

C# 코드의 파워 쉘 버전을 사용하고 있습니다 context = 새로운 AuthenticationContext (authority, TokenCache.DefaultShared); var result = Awaquit context.AcquireTokenAsync (resource, AssertionCert); return result.AccessToken; } "키 집합이 아닌 존재 않습니다"와 VAR 결과에서

이 코드 오류 출력

이 문제를 해결하기 위해 어떤 방법이 있나요?

당신을 :) 감사

답변

1

당신이 여기에 답을보고 했습니까? 그는 CustomKeyIdentifier 인증에 문제가되지 않습니다 null이되는 것을 언급 코멘트에서

Create a Application in Azure AD with Azure PowerShell Certificate authentication

.

는 관계없이 null 값의 인증을 시도 했 \

편집 :?

$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 
$cer.Import(“mycer.cer”) 
$bin = $cer.GetCertHash() 
$base64Thumbprint = [System.Convert]::ToBase64String($bin) 
: 당신이 소유 한 공용 인증서에 대한 지문을 생성 할 경우 , 당신은 그래서 다음과 같은 PowerShell을 cmdlet을 사용 할 수 있습니다

도움이 되었기를 바랍니다.

+0

예 ... 지정한 링크에 대한 답을 살펴 봤습니다. – Amruta

+0

그래서 문제는 응용 프로그램이 작동하지 않고 null이되는 문제입니까? –

+0

PowerShell 버전 (2.0.1)에 따라 위에서 언급 한 것과 동일한 코드를 작성했습니다. 커맨드 릿은이 버전에서 새로운 AzureADApplication을 생성하기 위해 변경되었습니다. Keyvault 비밀을 검색하는 인증서로 AD 애플리케이션을 인증하는 중 ... 따라서 manifest 파일을보고 있는데 거기에 "customKeyIdentifier"가 있습니다. null. 이 값을 얻으려면 어떻게해야합니까? 또는 Powershell 명령을 사용하여 인증서로 AD 응용 프로그램을 만들고이 CustomerKeyIdentifier 값을 얻으십시오 – Amruta