@@ -16,20 +16,6 @@ param(
16
16
There are four ways to run this script. For more information, read the AppCreationScripts.md file in the same folder as this script.
17
17
#>
18
18
19
- # Create an application key
20
- # See https://www.sabin.io/blog/adding-an-azure-active-directory-application-and-key-using-powershell/
21
- Function CreateAppKey ([DateTime ] $fromDate , [double ] $durationInMonths )
22
- {
23
- $key = New-Object Microsoft.Graph.PowerShell.Models.MicrosoftGraphPasswordCredential
24
-
25
- $key.StartDateTime = $fromDate
26
- $key.EndDateTime = $fromDate.AddMonths ($durationInMonths )
27
- $key.KeyId = (New-Guid ).ToString()
28
- $key.DisplayName = " app secret"
29
-
30
- return $key
31
- }
32
-
33
19
# Adds the requiredAccesses (expressed as a pipe separated string) to the requiredAccess structure
34
20
# The exposed permissions are in the $exposedPermissions collection, and the type of permission (Scope | Role) is
35
21
# described in $permissionType
@@ -291,10 +277,6 @@ Function ConfigureApplications
291
277
292
278
# Create the client AAD application
293
279
Write-Host " Creating the AAD application (TodoListClient-aspnetcore-webapi)"
294
- # Get a 6 months application key for the client Application
295
- $fromDate = [DateTime ]::Now;
296
- $key = CreateAppKey - fromDate $fromDate - durationInMonths 6
297
-
298
280
299
281
# create the application
300
282
$clientAadApplication = New-MgApplication - DisplayName " TodoListClient-aspnetcore-webapi" `
@@ -306,10 +288,6 @@ Function ConfigureApplications
306
288
} `
307
289
- SignInAudience AzureADMyOrg `
308
290
# end of command
309
- # add a secret to the application
310
- $pwdCredential = Add-MgApplicationPassword - ApplicationId $clientAadApplication.Id - PasswordCredential $key
311
- $clientAppKey = $pwdCredential.SecretText
312
-
313
291
$tenantName = (Get-MgApplication - ApplicationId $clientAadApplication.Id ).PublisherDomain
314
292
Update-MgApplication - ApplicationId $clientAadApplication.Id - IdentifierUris @ (" https://$tenantName /TodoListClient-aspnetcore-webapi" )
315
293
# Generate a certificate
0 commit comments