Skip to content

Commit cdcb29c

Browse files
committed
Refactored register cmdlet to default to interactive
1 parent c25b3c0 commit cdcb29c

File tree

5 files changed

+88
-276
lines changed

5 files changed

+88
-276
lines changed

documentation/Register-PnPAzureADApp.md

Lines changed: 9 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ Registers an Azure AD App and optionally creates a new self-signed certificate t
1818
```powershell
1919
Register-PnPAzureADApp -ApplicationName <String>
2020
-Tenant <String>
21-
[-Username <String>]
22-
[-Password <SecureString>]
2321
[-DeviceLogin]
24-
[-Interactive]
2522
[-CommonName <String>]
2623
[-OutPath <String>]
2724
[-Store <StoreLocation>]
@@ -36,63 +33,57 @@ Register-PnPAzureADApp -ApplicationName <String>
3633
[-OrganizationUnit <String>]
3734
[-ValidYears <Int>]
3835
[-CertificatePassword <SecureString>]
39-
[-NoPopup]
4036
[-LogoFilePath <string>]
4137
[-MicrosoftGraphEndPoint <string>]
4238
[-EntraIDLoginEndPoint <string>]
4339
[-SignInAudience <EntraIDSignInAudience>]
44-
[-LaunchBrowser <SwitchParameter>]
4540
```
4641

4742
### Existing Certificate
4843
```powershell
4944
Register-PnPAzureADApp -CertificatePath <String>
5045
-ApplicationName <String>
5146
-Tenant <String>
52-
[-Username <String>]
53-
[-Password <SecureString>]
5447
[-DeviceLogin]
55-
[-Interactive]
5648
[-GraphApplicationPermissions <Permission[]>]
5749
[-GraphDelegatePermissions <Permission[]>]
5850
[-SharePointApplicationPermissions <Permission[]>]
5951
[-SharePointDelegatePermissions <Permission[]>]
6052
[-CertificatePassword <SecureString>]
61-
[-NoPopup]
6253
[-LogoFilePath <string>]
63-
[-LaunchBrowser <SwitchParameter>]
6454
```
6555

6656
## DESCRIPTION
67-
Registers an Azure AD App and optionally creates a new self-signed certificate to use with the application registration. You can login either with username/password or you can use the -DeviceLogin option if your tenant has been configured for Multi-Factor Authentication.
57+
Registers an Azure AD App and optionally creates a new self-signed certificate to use with the application registration.
6858

69-
Note: if you want to use the newly created app to authenticate with username/password you will have to make a modification to the app. Navigate to the application registration in your Azure AD, select the Authentication section, and set `Allow public client flows` to `yes`. Alternatively, navigate to the `Manifest` section and set `allowPublicClient` to `true`.
59+
Note: if you want to use the newly created app to authenticate with username/password. Use `Register-PnPEntraIDAppForInteractiveLogin` to create an app that allows users to login with.
7060

7161
## EXAMPLES
7262

7363
### EXAMPLE 1
7464
```powershell
75-
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser -Interactive
65+
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser
7666
```
7767

7868
Creates a new Azure AD Application registration, creates a new self signed certificate, and adds it to the local certificate store. It will upload the certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All. A browser window will be shown allowing you to authenticate.
7969

8070
### EXAMPLE 2
8171
```powershell
82-
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force) -Interactive
72+
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)
8373
```
8474

8575
Creates a new Azure AD Application registration which will use the existing private key certificate at the provided path to allow access. It will upload the provided private key certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All. A browser window will be shown allowing you to authenticate.
76+
8677
### EXAMPLE 3
8778
```powershell
88-
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser -GraphApplicationPermissions "User.Read.All" -SharePointApplicationPermissions "Sites.Read.All" -Interactive
79+
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Store CurrentUser -GraphApplicationPermissions "User.Read.All" -SharePointApplicationPermissions "Sites.Read.All"
8980
```
9081

9182
Creates a new Azure AD Application registration, creates a new self signed certificate, and adds it to the local certificate store. It will upload the certificate to the azure app registration and it will request the following permissions: Sites.Read.All, User.Read.All. A browser window will be shown allowing you to authenticate.
9283

9384
### EXAMPLE 4
9485
```powershell
95-
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -OutPath c:\ -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force) -Interactive
86+
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -OutPath c:\ -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)
9687
```
9788

9889
Creates a new Azure AD Application registration, creates a new self signed certificate, and stores the public and private key certificates in c:\. The private key certificate will be locked with the password "password". It will upload the certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All. A browser window will be shown allowing you to authenticate.
@@ -106,56 +97,20 @@ Creates a new Azure AD Application registration and asks you to authenticate usi
10697

10798
### EXAMPLE 6
10899
```powershell
109-
Register-PnPAzureADApp -Interactive -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)
100+
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force)
110101
```
111102

112103
Creates a new Azure AD Application registration and asks you to authenticate using username and password, creates a new self signed certificate, and adds it to the local certificate store. It will upload the certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All
113104

114105
### EXAMPLE 7
115106
```powershell
116-
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force) -Interactive -LogoFilePath c:\logo.png
107+
Register-PnPAzureADApp -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -CertificatePath c:\certificate.pfx -CertificatePassword (ConvertTo-SecureString -String "password" -AsPlainText -Force) -LogoFilePath c:\logo.png
117108
```
118109

119110
Creates a new Azure AD Application registration which will use the existing private key certificate at the provided path to allow access. It will upload the provided private key certificate to the azure app registration and it will request the following permissions: Sites.FullControl.All, Group.ReadWrite.All, User.Read.All. It will also set the `logo.png` file as the logo for the Azure AD app.
120111

121112
## PARAMETERS
122113

123-
### -Interactive
124-
If specified, an interactive authentication flow will be started, allowing your to authenticate with username, password and an optional second factor from your phone or other device.
125-
126-
```yaml
127-
Type: SwitchParameter
128-
Parameter Sets: (All)
129-
130-
Required: False
131-
Position: Named
132-
Accept pipeline input: False
133-
```
134-
135-
### -Username
136-
The username to use when logging into the Microsoft Graph. Notice that this user account needs to have write access to the Azure AD.
137-
138-
```yaml
139-
Type: String
140-
Parameter Sets: (All)
141-
142-
Required: False
143-
Position: Named
144-
Accept pipeline input: False
145-
```
146-
147-
### -Password
148-
The password to use when logging into the Microsoft Graph.
149-
150-
```yaml
151-
Type: String
152-
Parameter Sets: (All)
153-
154-
Required: False
155-
Position: Named
156-
Accept pipeline input: False
157-
```
158-
159114
### -DeviceLogin
160115
If specified, a device login flow, supporting Multi-Factor Authentication will be used to authenticate towards the Microsoft Graph.
161116

@@ -372,20 +327,6 @@ Position: 7
372327
Accept pipeline input: False
373328
```
374329
375-
### -NoPopup
376-
This switch only applies to Windows and has no effect on Linux and MacOS.
377-
378-
If not specified and running on Windows, all authentication and consent steps will be presented in a popup. If you want to open the URLs manually in a browser, specify this switch.
379-
380-
```yaml
381-
Type: SwitchParameter
382-
Parameter Sets: (All)
383-
384-
Required: False
385-
Position: Named
386-
Accept pipeline input: False
387-
```
388-
389330
### -AzureEnvironment
390331
The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment.
391332
@@ -454,21 +395,6 @@ Position: Named
454395
Accept pipeline input: False
455396
```
456397

457-
### -LaunchBrowser
458-
Launch a browser automatically and copy the code to enter to the clipboard
459-
460-
```yaml
461-
Type: SwitchParameter
462-
Parameter Sets: DeviceLogin
463-
Aliases:
464-
465-
Required: False
466-
Position: Named
467-
Default value: False
468-
Accept pipeline input: False
469-
Accept wildcard characters: False
470-
```
471-
472398
## RELATED LINKS
473399

474400
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)

documentation/Register-PnPEntraIDAppForInteractiveLogin.md

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ Registers an Entra ID App for use with Interactive login
1818
```powershell
1919
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName <String>
2020
-Tenant <String>
21-
-Interactive]
2221
[-GraphApplicationPermissions <Permission[]>]
2322
[-GraphDelegatePermissions <Permission[]>]
2423
[-SharePointApplicationPermissions <Permission[]>]
2524
[-SharePointDelegatePermissions <Permission[]>]
26-
[-NoPopup]
2725
[-LogoFilePath <string>]
2826
[-MicrosoftGraphEndPoint <string>]
2927
[-EntraIDLoginEndPoint <string>]
3028
[-SignInAudience <EntraIDSignInAudience>]
31-
[-LaunchBrowser <SwitchParameter>]
3229
```
3330

3431
### Generate App using Device Login
@@ -40,45 +37,31 @@ Register-PnPEntraIDAppForInteractiveLogin -ApplicationName <String>
4037
[-GraphDelegatePermissions <Permission[]>]
4138
[-SharePointApplicationPermissions <Permission[]>]
4239
[-SharePointDelegatePermissions <Permission[]>]
43-
[-NoPopup]
4440
[-LogoFilePath <string>]
4541
[-SignInAudience <EntraIDSignInAudience>]
46-
[-LaunchBrowser <SwitchParameter>]
4742
```
4843

4944
## DESCRIPTION
50-
Registers an Entra ID App for use with the interactive login on Connect-PnPOnline. You will have to specify either -Interactive or -DeviceLogin to authenticate.
45+
Registers an Entra ID App for use with the interactive login on Connect-PnPOnline. By default it assumes an Interactive login, but you can decide to use Device Login auth by specifying -DeviceLogin.
5146

5247
## EXAMPLES
5348

5449
### EXAMPLE 1
5550
```powershell
56-
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -Interactive
51+
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com
5752
```
5853

5954
Creates a new Entra ID Application registration. The application will be setup with the following delegate permissions to consent: AllSites.FullControl, Group.ReadWrite.All, User.ReadWrite.All, TermStore.ReadWrite.All. A browser window will be shown allowing you to authenticate.
6055

6156
### EXAMPLE 2
6257
```powershell
63-
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -GraphDelegatePermissions "Group.Read.All" -SharePointDelegatePermissions "AllSites.FullControl" -Interactive
58+
Register-PnPEntraIDAppForInteractiveLogin -ApplicationName TestApp -Tenant yourtenant.onmicrosoft.com -GraphDelegatePermissions "Group.Read.All" -SharePointDelegatePermissions "AllSites.FullControl"
6459
```
6560

6661
Creates a new Entra ID Application registration. The application will be setup with the following delegate permissions to consent: Group.Read.All, AllSites.FullControl. A browser window will be shown allowing you to authenticate.
6762

6863
## PARAMETERS
6964

70-
### -Interactive
71-
If specified, an interactive authentication flow will be started, allowing your to authenticate with username, password and an optional second factor from your phone or other device.
72-
73-
```yaml
74-
Type: SwitchParameter
75-
Parameter Sets: (All)
76-
77-
Required: False
78-
Position: Named
79-
Accept pipeline input: False
80-
```
81-
8265
### -DeviceLogin
8366
If specified, a device login flow, supporting Multi-Factor Authentication will be used to authenticate towards the Microsoft Graph.
8467

@@ -163,20 +146,6 @@ Position: Named
163146
Accept pipeline input: False
164147
```
165148
166-
### -NoPopup
167-
This switch only applies to Windows and has no effect on Linux and MacOS.
168-
169-
If not specified and running on Windows, all authentication and consent steps will be presented in a popup. If you want to open the URLs manually in a browser, specify this switch.
170-
171-
```yaml
172-
Type: SwitchParameter
173-
Parameter Sets: (All)
174-
175-
Required: False
176-
Position: Named
177-
Accept pipeline input: False
178-
```
179-
180149
### -AzureEnvironment
181150
The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment.
182151
@@ -245,21 +214,6 @@ Position: Named
245214
Accept pipeline input: False
246215
```
247216

248-
### -LaunchBrowser
249-
Launch a browser automatically and copy the code to enter to the clipboard
250-
251-
```yaml
252-
Type: SwitchParameter
253-
Parameter Sets: DeviceLogin
254-
Aliases:
255-
256-
Required: False
257-
Position: Named
258-
Default value: False
259-
Accept pipeline input: False
260-
Accept wildcard characters: False
261-
```
262-
263217
## RELATED LINKS
264218

265219
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)

0 commit comments

Comments
 (0)