You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Updated api pattern and target framework
* api pattern_not mandatory requirement
* Updated graph api calls using Graph SDK
* Check client Id to access API
* Removed manual step to add platform
* Made a few fixes
* Updated the pattern for custom OnTokenValidated event
* small improvements
* README sync with code generator
* Adjusted KCA text
* Updated Readme files and topologies
* Rename the AddPop method (#146)
into AddProofOfPosession
* Update for Merge error
Co-authored-by: Kalyan Krishna <kalyan.krishna@microsoft.com>
Co-authored-by: Tiago Brenck <v-tibre@microsoft.com>
Co-authored-by: Jean-Marc Prieur <jmprieur@microsoft.com>
Copy file name to clipboardExpand all lines: 2. Web API now calls Microsoft Graph/AppCreationScripts/AppCreationScripts.md
+24-4Lines changed: 24 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Registering the sample apps with Microsoft Identity Platform and updating the configuration files using PowerShell scripts
1
+
# Registering the sample apps with Microsoft identity platform and updating the configuration files using PowerShell scripts
2
2
3
3
## Overview
4
4
@@ -11,7 +11,8 @@
11
11
```
12
12
1. Run the script to create your Azure AD application and configure the code of the sample application accordingly. (Other ways of running the scripts are described below)
13
13
```PowerShell
14
-
.\AppCreationScripts\Configure.ps1
14
+
cd .\AppCreationScripts\
15
+
.\Configure.ps1
15
16
```
16
17
1. Open the Visual Studio solution and click start
17
18
@@ -26,6 +27,7 @@ The following paragraphs:
26
27
-[Passing credentials](#option-2-non-interactive) to create the app in your home tenant
27
28
-[Interactively in a specific tenant](#option-3-interactive-but-create-apps-in-a-specified-tenant)
28
29
-[Passing credentials in a specific tenant](#option-4-non-interactive-and-create-apps-in-a-specified-tenant)
30
+
-[Passing environment name, for Sovereign clouds](#running-the-script-on-azure-sovereign-clouds)
29
31
30
32
## Goal of the scripts
31
33
@@ -49,7 +51,7 @@ These scripts are:
49
51
50
52
The `Configure.ps1` will stop if it tries to create an Azure AD application which already exists in the tenant. For this, if you are using the script to try/test the sample, or in DevOps scenarios, you might want to run `Cleanup.ps1` just before `Configure.ps1`. This is what is shown in the steps below.
51
53
52
-
## How to use the app creation scripts?
54
+
## How to use the app creation scripts?
53
55
54
56
### Pre-requisites
55
57
@@ -107,7 +109,7 @@ Note that the script will choose the tenant in which to create the applications,
107
109
108
110
#### Option 2 (non-interactive)
109
111
110
-
When you know the indentity and credentials of the user in the name of whom you want to create the applications, you can use the non-interactive approach. It's more adapted to DevOps. Here is an example of script you'd want to run in a PowerShell Window
112
+
When you know the identity and credentials of the user in the name of whom you want to create the applications, you can use the non-interactive approach. It's more adapted to DevOps. Here is an example of script you'd want to run in a PowerShell Window
All the four options listed above, can be used on any Azure Sovereign clouds. By default, the script targets `AzureCloud`, but it can be changed using the parameter `-AzureEnvironmentName`.
Copy file name to clipboardExpand all lines: 2. Web API now calls Microsoft Graph/AppCreationScripts/Cleanup.ps1
+28-18Lines changed: 28 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,14 @@
2
2
param(
3
3
[PSCredential] $Credential,
4
4
[Parameter(Mandatory=$False,HelpMessage='Tenant ID (This is a GUID which represents the "Directory ID" of the AzureAD tenant into which you want to create the apps')]
5
-
[string] $tenantId
5
+
[string] $tenantId,
6
+
[Parameter(Mandatory=$False,HelpMessage='Azure environment to use while running the script (it defaults to AzureCloud)')]
7
+
[string] $azureEnvironmentName
6
8
)
7
9
10
+
#Requires -ModulesAzureAD
11
+
12
+
8
13
if ($null-eq (Get-Module-ListAvailable -Name "AzureAD")) {
Copy file name to clipboardExpand all lines: 2. Web API now calls Microsoft Graph/AppCreationScripts/Configure.ps1
+31-20Lines changed: 31 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,13 @@
2
2
param(
3
3
[PSCredential] $Credential,
4
4
[Parameter(Mandatory=$False,HelpMessage='Tenant ID (This is a GUID which represents the "Directory ID" of the AzureAD tenant into which you want to create the apps')]
5
-
[string] $tenantId
5
+
[string] $tenantId,
6
+
[Parameter(Mandatory=$False,HelpMessage='Azure environment to use while running the script (it defaults to AzureCloud)')]
7
+
[string] $azureEnvironmentName
6
8
)
7
9
10
+
#Requires -ModulesAzureAD
11
+
8
12
<#
9
13
This script creates the Azure AD applications needed for this sample and updates the configuration files
10
14
for the visual Studio projects from the data in the Azure AD applications.
@@ -201,6 +205,11 @@ Function ConfigureApplications
201
205
so that they are consistent with the Applications parameters
202
206
#>
203
207
$commonendpoint="common"
208
+
209
+
if (!$azureEnvironmentName)
210
+
{
211
+
$azureEnvironmentName="AzureCloud"
212
+
}
204
213
205
214
# $tenantId is the Active Directory Tenant. This is a GUID which represents the "Directory ID" of the AzureAD tenant
206
215
# into which you want to create the apps. Look it up in the Azure portal in the "Properties" of the Azure AD.
@@ -209,17 +218,17 @@ Function ConfigureApplications
209
218
# you'll need to sign-in with creds enabling your to create apps in the tenant)
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
379
390
Write-Host"IMPORTANT: Please follow the instructions below to complete a few manual step(s) in the Azure portal":
@@ -383,7 +394,7 @@ Function ConfigureApplications
383
394
Write-Host"- For 'client'"
384
395
Write-Host" - Navigate to '$clientPortalUrl'"
385
396
Write-Host" - Navigate to the Manifest page and change 'signInAudience' to 'AzureADandPersonalMicrosoftAccount'."-ForegroundColor Red
386
-
Write-Host" - [Optional] If you are a tenant admin, you can navigate to the API Permisions page and select 'Grant admin consent for (your tenant)'"-ForegroundColor Red
397
+
Write-Host" - [Optional] If you are a tenant admin, you can navigate to the API Permissions page and select 'Grant admin consent for (your tenant)'"-ForegroundColor Red
387
398
388
399
Write-Host-ForegroundColor Green "------------------------------------------------------------------------------------------------"
0 commit comments