Skip to content

Commit bfd247e

Browse files
committed
Remove of UseWebLogin
1 parent 5c64675 commit bfd247e

File tree

7 files changed

+12
-255
lines changed

7 files changed

+12
-255
lines changed

.vscode/tasks.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,12 @@
3737
"group": {
3838
"kind": "build",
3939
"isDefault": true
40-
}
40+
},
41+
"icon": {
42+
"id": "run",
43+
"color": "terminal.ansiYellow"
44+
},
45+
4146
},
4247
{
4348
"label": "Build with local copy of PnP Framework/PnP Core SDK",

documentation/Connect-PnPOnline.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -666,29 +666,6 @@ Accept pipeline input: False
666666
Accept wildcard characters: False
667667
```
668668

669-
### -UseWebLogin
670-
Windows only: Connects to SharePoint using legacy cookie based authentication.
671-
Notice this type of authentication is limited in its functionality.
672-
We will for instance not be able to acquire an access token for the Graph, and as a result none of the Graph related cmdlets will work.
673-
Also some of the functionality of the provisioning engine (Get-PnPSiteTemplate, Get-PnPTenantTemplate, Invoke-PnPSiteTemplate, Invoke-PnPTenantTemplate) will not work because of this reason.
674-
The cookies will in general expire within a few days and if you use -UseWebLogin within that time popup window will appear that will disappear immediately, this is expected.
675-
Use -ForceAuthentication to reset the authentication cookies and force a new login.
676-
677-
```yaml
678-
Type: SwitchParameter
679-
Parameter Sets: Web Login for Multi Factor Authentication
680-
Aliases:
681-
682-
Required: True
683-
Position: Named
684-
Default value: False
685-
Accept pipeline input: False
686-
Accept wildcard characters: False
687-
```
688-
689-
### -RelativeUrl
690-
The site-relative URL of the site you're collecting to. Only applies if you're using -UseWebLogin.
691-
692669
```yaml
693670
Type: String
694671
Parameter Sets: Web Login for Multi Factor Authentication
@@ -703,7 +680,6 @@ Accept wildcard characters: False
703680

704681
### -Interactive
705682
Connects to the Entra ID (Azure AD) using interactive login, allowing you to authenticate using multi-factor authentication.
706-
This parameter has preference over \`-UseWebLogin\`.
707683

708684
```yaml
709685
Type: SwitchParameter
@@ -718,7 +694,7 @@ Accept wildcard characters: False
718694
```
719695

720696
### -ForceAuthentication
721-
Will clear the stored authentication information when using -UseWebLogin (Windows Only) or -Interactive (all platforms) and allows you to authenticate again towards a site with different credentials.
697+
Will clear the stored authentication information when using Interactive login (all platforms) and allows you to authenticate again towards a site with different credentials.
722698

723699
```yaml
724700
Type: SwitchParameter

src/Commands/Base/ConnectOnline.cs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public class ConnectOnline : BasePSCmdlet
3030
private const string ParameterSet_SPOMANAGEMENT = "SPO Management Shell Credentials";
3131
private const string ParameterSet_DEVICELOGIN = "PnP Management Shell / DeviceLogin";
3232
private const string ParameterSet_ACCESSTOKEN = "Access Token";
33-
private const string ParameterSet_WEBLOGIN = "Web Login for Multi Factor Authentication";
3433
private const string ParameterSet_SYSTEMASSIGNEDMANAGEDIDENTITY = "System Assigned Managed Identity";
3534
private const string ParameterSet_USERASSIGNEDMANAGEDIDENTITYBYCLIENTID = "User Assigned Managed Identity by Client Id";
3635
private const string ParameterSet_USERASSIGNEDMANAGEDIDENTITYBYPRINCIPALID = "User Assigned Managed Identity by Principal Id";
@@ -49,7 +48,6 @@ public class ConnectOnline : BasePSCmdlet
4948
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_APPONLYAADTHUMBPRINT, ValueFromPipeline = true)]
5049
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SPOMANAGEMENT, ValueFromPipeline = true)]
5150
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_DEVICELOGIN, ValueFromPipeline = true)]
52-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN, ValueFromPipeline = true)]
5351
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_INTERACTIVE, ValueFromPipeline = true)]
5452
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ACCESSTOKEN, ValueFromPipeline = true)]
5553
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ENVIRONMENTVARIABLE, ValueFromPipeline = true)]
@@ -67,7 +65,6 @@ public class ConnectOnline : BasePSCmdlet
6765
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_APPONLYAADTHUMBPRINT, ValueFromPipeline = true)]
6866
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SPOMANAGEMENT, ValueFromPipeline = true)]
6967
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_DEVICELOGIN, ValueFromPipeline = true)]
70-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN, ValueFromPipeline = true)]
7168
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_INTERACTIVE, ValueFromPipeline = true)]
7269
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ACCESSTOKEN, ValueFromPipeline = true)]
7370
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ENVIRONMENTVARIABLE, ValueFromPipeline = true)]
@@ -86,7 +83,6 @@ public class ConnectOnline : BasePSCmdlet
8683
[Parameter(Mandatory = true, Position = 0, ParameterSetName = ParameterSet_SPOMANAGEMENT, ValueFromPipeline = true)]
8784
[Parameter(Mandatory = true, Position = 0, ParameterSetName = ParameterSet_ACCESSTOKEN, ValueFromPipeline = true)]
8885
[Parameter(Mandatory = true, Position = 0, ParameterSetName = ParameterSet_DEVICELOGIN, ValueFromPipeline = true)]
89-
[Parameter(Mandatory = true, Position = 0, ParameterSetName = ParameterSet_WEBLOGIN, ValueFromPipeline = true)]
9086
[Parameter(Mandatory = true, Position = 0, ParameterSetName = ParameterSet_INTERACTIVE, ValueFromPipeline = true)]
9187
[Parameter(Mandatory = false, Position = 0, ParameterSetName = ParameterSet_SYSTEMASSIGNEDMANAGEDIDENTITY, ValueFromPipeline = true)]
9288
[Parameter(Mandatory = false, Position = 0, ParameterSetName = ParameterSet_USERASSIGNEDMANAGEDIDENTITYBYCLIENTID, ValueFromPipeline = true)]
@@ -130,7 +126,6 @@ public class ConnectOnline : BasePSCmdlet
130126
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_APPONLYAADTHUMBPRINT)]
131127
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SPOMANAGEMENT)]
132128
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_DEVICELOGIN)]
133-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN)]
134129
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_INTERACTIVE)]
135130
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ENVIRONMENTVARIABLE)]
136131
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_OSLOGIN)]
@@ -142,7 +137,6 @@ public class ConnectOnline : BasePSCmdlet
142137
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_APPONLYAADTHUMBPRINT)]
143138
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SPOMANAGEMENT)]
144139
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_DEVICELOGIN)]
145-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN)]
146140
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_INTERACTIVE)]
147141
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ENVIRONMENTVARIABLE)]
148142
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_OSLOGIN)]
@@ -220,7 +214,6 @@ public class ConnectOnline : BasePSCmdlet
220214
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_APPONLYAADCERTIFICATE)]
221215
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_APPONLYAADTHUMBPRINT)]
222216
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_SPOMANAGEMENT)]
223-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN)]
224217
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_INTERACTIVE)]
225218
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ENVIRONMENTVARIABLE)]
226219
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_OSLOGIN)]
@@ -246,13 +239,6 @@ public class ConnectOnline : BasePSCmdlet
246239
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_ENVIRONMENTVARIABLE)]
247240
public SwitchParameter TransformationOnPrem;
248241

249-
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_WEBLOGIN)]
250-
public SwitchParameter UseWebLogin;
251-
252-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN)]
253-
public string RelativeUrl;
254-
255-
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_WEBLOGIN)]
256242
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_INTERACTIVE)]
257243
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_OSLOGIN)]
258244
public SwitchParameter ForceAuthentication;
@@ -396,9 +382,6 @@ protected void Connect(ref CancellationToken cancellationToken)
396382
case ParameterSet_USERASSIGNEDMANAGEDIDENTITYBYAZURERESOURCEID:
397383
newConnection = ConnectManagedIdentity();
398384
break;
399-
case ParameterSet_WEBLOGIN:
400-
newConnection = ConnectWebLogin();
401-
break;
402385
case ParameterSet_INTERACTIVE:
403386
newConnection = ConnectInteractive();
404387
break;
@@ -788,28 +771,6 @@ private PnPConnection ConnectManagedIdentity()
788771
return PnPConnection.CreateWithManagedIdentity(this, Url, TenantAdminUrl, UserAssignedManagedIdentityObjectId, UserAssignedManagedIdentityClientId, UserAssignedManagedIdentityAzureResourceId);
789772
}
790773

791-
private PnPConnection ConnectWebLogin()
792-
{
793-
WriteVerbose("Connecting using WebLogin");
794-
WriteWarning("Consider using -Interactive or -OSLogin instead, which provides better functionality. This will be removed in a future release. See the documentation at https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html#interactive-for-multi-factor-authentication");
795-
796-
if (Utilities.OperatingSystem.IsWindows())
797-
{
798-
if (!string.IsNullOrWhiteSpace(RelativeUrl))
799-
{
800-
return PnPConnection.CreateWithWeblogin(new Uri(Url.ToLower()), TenantAdminUrl, ForceAuthentication, siteRelativeUrl: RelativeUrl);
801-
}
802-
else
803-
{
804-
return PnPConnection.CreateWithWeblogin(new Uri(Url.ToLower()), TenantAdminUrl, ForceAuthentication);
805-
}
806-
}
807-
else
808-
{
809-
throw new PSArgumentException("-UseWebLogin only works when running on Microsoft Windows due to the requirement to show a login window.");
810-
}
811-
}
812-
813774
private PnPConnection ConnectInteractive()
814775
{
815776
WriteVerbose("Connecting using Interactive login");

0 commit comments

Comments
 (0)