Skip to content

Commit 68caf90

Browse files
author
Kalyan Krishna
committed
another round of minor edits
1 parent 957dbf8 commit 68caf90

File tree

9 files changed

+11
-852
lines changed

9 files changed

+11
-852
lines changed

4-WebApp-your-API/4-1-MyOrg/AppCreationScripts-withCert/Configure.ps1

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ param(
1616
There are four ways to run this script. For more information, read the AppCreationScripts.md file in the same folder as this script.
1717
#>
1818

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-
3319
# Adds the requiredAccesses (expressed as a pipe separated string) to the requiredAccess structure
3420
# The exposed permissions are in the $exposedPermissions collection, and the type of permission (Scope | Role) is
3521
# described in $permissionType
@@ -291,10 +277,6 @@ Function ConfigureApplications
291277

292278
# Create the client AAD application
293279
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-
298280

299281
# create the application
300282
$clientAadApplication = New-MgApplication -DisplayName "TodoListClient-aspnetcore-webapi" `
@@ -306,10 +288,6 @@ Function ConfigureApplications
306288
} `
307289
-SignInAudience AzureADMyOrg `
308290
#end of command
309-
#add a secret to the application
310-
$pwdCredential = Add-MgApplicationPassword -ApplicationId $clientAadApplication.Id -PasswordCredential $key
311-
$clientAppKey = $pwdCredential.SecretText
312-
313291
$tenantName = (Get-MgApplication -ApplicationId $clientAadApplication.Id).PublisherDomain
314292
Update-MgApplication -ApplicationId $clientAadApplication.Id -IdentifierUris @("https://$tenantName/TodoListClient-aspnetcore-webapi")
315293
# Generate a certificate

4-WebApp-your-API/4-1-MyOrg/AppCreationScripts-withCert/README-use-certificate.md

Lines changed: 0 additions & 113 deletions
This file was deleted.

0 commit comments

Comments
 (0)