File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -49,12 +49,13 @@ Ensure the following before you begin:
49
49
$app = Get-AzureADServicePrincipal -Filter "AppId eq '$clientId'"
50
50
$objectId = $app.ObjectId
51
51
52
- $secret = New-AzureADServicePrincipalPasswordCredential -ObjectId $objectId -EndDate $endDate
53
- New-AzureADServicePrincipalKeyCredential -ObjectId $objectId -EndDate $endDate -Type Symmetric -Usage Verify -Value $secret.Value
54
- New-AzureADServicePrincipalKeyCredential -ObjectId $objectId -EndDate $endDate -Type Symmetric -Usage Sign -Value $secret.Value
52
+ $base64secret = New-AzureADServicePrincipalPasswordCredential -ObjectId $objectId -EndDate $endDate
53
+ $secret = [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($base64secret.Value))
54
+ New-AzureADServicePrincipalKeyCredential -ObjectId $objectId -EndDate $endDate -Type Symmetric -Usage Verify -Value $secret
55
+ New-AzureADServicePrincipalKeyCredential -ObjectId $objectId -EndDate $endDate -Type Symmetric -Usage Sign -Value $secret
55
56
56
- $secret .Value
57
- $secret .EndDate # Print the end date.
57
+ $base64secret .Value
58
+ $base64secret .EndDate # Print the end date.
58
59
```
59
60
60
61
4. The new client secret appears on the Windows PowerShell console. Copy it to a text file. You use it in the next procedure.
You can’t perform that action at this time.
0 commit comments