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
Copy file name to clipboardExpand all lines: 5-WebApp-AuthZ/5-2-Groups/AppCreationScripts/AppCreationScripts.md
+39-19Lines changed: 39 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,35 +1,47 @@
1
-
# Registering the sample apps with Microsoft identity platform and updating the configuration files using PowerShell scripts
1
+
# Registering the sample apps with the Microsoft identity platform and updating the configuration files using PowerShell
2
2
3
3
## Overview
4
4
5
5
### Quick summary
6
6
7
7
1. On Windows run PowerShell and navigate to the root of the cloned directory
8
8
1. In PowerShell run:
9
+
9
10
```PowerShell
10
11
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force
11
12
```
13
+
12
14
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)
15
+
13
16
```PowerShell
14
17
cd .\AppCreationScripts\
15
18
.\Configure.ps1
16
19
```
20
+
17
21
1. Open the Visual Studio solution and click start
18
22
19
23
### More details
20
24
21
25
The following paragraphs:
22
26
23
-
-[Present the scripts](#presentation-of-the-scripts) and explain their [usage patterns](#usage-pattern-for-tests-and-devops-scenarios) for test and DevOps scenarios.
24
-
- Explain the [pre-requisites](#pre-requisites)
25
-
- Explain [four ways of running the scripts](#four-ways-to-run-the-script):
26
-
-[Interactively](#option-1-interactive) to create the app in your home tenant
27
-
-[Passing credentials](#option-2-non-interactive) to create the app in your home tenant
28
-
-[Interactively in a specific tenant](#option-3-interactive-but-create-apps-in-a-specified-tenant)
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)
31
-
32
-
## Goal of the scripts
27
+
-[Registering the sample apps with the Microsoft identity platform and updating the configuration files using PowerShell](#Registering-the-sample-apps-with-the-Microsoft-identity-platform-and-updating-the-configuration-files-using-PowerShell)
28
+
-[Overview](#Overview)
29
+
-[Quick summary](#Quick-summary)
30
+
-[More details](#More-details)
31
+
-[Goal of the provided scripts](#Goal-of-the-provided-scripts)
32
+
-[Presentation of the scripts](#Presentation-of-the-scripts)
33
+
-[Usage pattern for tests and DevOps scenarios](#Usage-pattern-for-tests-and-DevOps-scenarios)
34
+
-[How to use the app creation scripts?](#How-to-use-the-app-creation-scripts)
35
+
-[Pre-requisites](#Pre-requisites)
36
+
-[Run the script and start running](#Run-the-script-and-start-running)
37
+
-[Four ways to run the script](#Four-ways-to-run-the-script)
-[Option 3 (Interactive, but create apps in a specified tenant)](#Option-3-Interactive-but-create-apps-in-a-specified-tenant)
41
+
-[Option 4 (non-interactive, and create apps in a specified tenant)](#Option-4-non-interactive-and-create-apps-in-a-specified-tenant)
42
+
-[Running the script on Azure Sovereign clouds](#Running-the-script-on-Azure-Sovereign-clouds)
43
+
44
+
## Goal of the provided scripts
33
45
34
46
### Presentation of the scripts
35
47
@@ -56,36 +68,43 @@ The `Configure.ps1` will stop if it tries to create an Azure AD application whic
56
68
### Pre-requisites
57
69
58
70
1. Open PowerShell (On Windows, press `Windows-R` and type `PowerShell` in the search window)
59
-
2. Navigate to the root directory of the project.
60
-
3. Until you change it, the default [Execution Policy](https:/go.microsoft.com/fwlink/?LinkID=135170) for scripts is usually `Restricted`. In order to run the PowerShell script you need to set the Execution Policy to `RemoteSigned`. You can set this just for the current PowerShell process by running the command:
71
+
1. Navigate to the root directory of the project.
72
+
1. Until you change it, the default [Execution Policy](https:/go.microsoft.com/fwlink/?LinkID=135170) for scripts is usually `Restricted`. In order to run the PowerShell script you need to set the Execution Policy to `RemoteSigned`. You can set this just for the current PowerShell process by running the command:
73
+
61
74
```PowerShell
62
75
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
The scripts install the required PowerShell module (AzureAD) for the current user if needed. However, if you want to install if for all users on the machine, you can follow the following steps:
66
81
67
-
4. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
82
+
1. If you have never done it already, in the PowerShell window, install the AzureAD PowerShell modules. For this:
68
83
69
84
1. Open PowerShell as admin (On Windows, Search Powershell in the search bar, right click on it and select Run as administrator).
70
85
2. Type:
86
+
71
87
```PowerShell
72
88
Install-Module AzureAD
73
89
```
74
90
75
91
or if you cannot be administrator on your machine, run:
92
+
76
93
```PowerShell
77
94
Install-Module AzureAD -Scope CurrentUser
78
95
```
79
96
80
97
### Run the script and start running
81
98
82
-
5. Go to the `AppCreationScripts` sub-folder. From the folder where you cloned the repo,
99
+
1. Go to the `AppCreationScripts` sub-folder. From the folder where you cloned the repo,
100
+
83
101
```PowerShell
84
102
cd AppCreationScripts
85
103
```
86
-
6. Run the scripts. See below for the [four options](#four-ways-to-run-the-script) to do that.
87
-
7. Open the Visual Studio solution, and in the solution's context menu, choose **Set Startup Projects**.
88
-
8. select **Start** for the projects
104
+
105
+
1. Run the scripts. See below for the [four options](#four-ways-to-run-the-script) to do that.
106
+
1. Open the Visual Studio solution, and in the solution's context menu, choose **Set Startup Projects**.
107
+
1. select **Start** for the projects
89
108
90
109
You're done. this just works!
91
110
@@ -123,6 +142,7 @@ Of course, in real life, you might already get the password as a `SecureString`.
123
142
#### Option 3 (Interactive, but create apps in a specified tenant)
124
143
125
144
if you want to create the apps in a particular tenant, you can use the following option:
145
+
126
146
- open the [Azure portal](https://portal.azure.com)
127
147
- Select the Azure Active directory you are interested in (in the combo-box below your name on the top right of the browser window)
128
148
- Find the "Active Directory" object in this tenant
/// This method inspects the claims collection created from the ID or Access token and detects groups overage. If Groups overage is detected, the method then makes calls to
17
+
/// Microsoft Graph to fetch the group membership of the authenticated user.
0 commit comments