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
Note: this issue will be resolved in a PR coming shortly.
Problem
In PnP.psm1, for ServicePrincipalWithThumbprint the complete opposite of ServicePrincipalWithPath is used in the if-statement. The two should be identical. See my comments starting with # ====> ....
if ($Global:MSCloudLoginConnectionProfile.PnP.AuthenticationType-eq'ServicePrincipalWithThumbprint')
{
# ====> Here, for Certificate Thumbprint, if (-not $url) is usedif (-not$Url)
{
Write-Information-Message 'Connecting with Service Principal - Thumbprint'Write-Information-Message "URL: $Url"Write-Information-Message "ConnectionUrl: $($Global:MSCloudLoginConnectionProfile.PnP.ConnectionUrl)"Connect-PnPOnline-Url $Global:MSCloudLoginConnectionProfile.PnP.ConnectionUrl`-ClientId $Global:MSCloudLoginConnectionProfile.PnP.ApplicationId`-Tenant $Global:MSCloudLoginConnectionProfile.PnP.TenantId`-Thumbprint $Global:MSCloudLoginConnectionProfile.PnP.CertificateThumbprint`-AzureEnvironment $Global:MSCloudLoginConnectionProfile.PnP.PnPAzureEnvironment|Out-Null
}
elseif ($Global:MSCloudLoginConnectionProfile.PnP.AdminUrl)
{
Write-Information-Message 'Connecting with Service Principal - Thumbprint'Write-Information-Message "URL: $Url"Write-Information-Message "AdminUrl: $($Global:MSCloudLoginConnectionProfile.PnP.AdminUrl)"Connect-PnPOnline-Url $Global:MSCloudLoginConnectionProfile.PnP.AdminUrl`-ClientId $Global:MSCloudLoginConnectionProfile.PnP.ApplicationId`-Tenant $Global:MSCloudLoginConnectionProfile.PnP.TenantId`-Thumbprint $Global:MSCloudLoginConnectionProfile.PnP.CertificateThumbprint`-AzureEnvironment $Global:MSCloudLoginConnectionProfile.PnP.PnPAzureEnvironment|Out-Null
}
$Global:MSCloudLoginConnectionProfile.PnP.ConnectedDateTime= [System.DateTime]::Now.ToString()
$Global:MSCloudLoginConnectionProfile.PnP.MultiFactorAuthentication=$false$Global:MSCloudLoginConnectionProfile.PnP.Connected=$true
}
elseif ($Global:MSCloudLoginConnectionProfile.PnP.AuthenticationType-eq'ServicePrincipalWithPath')
{
# ====> Here, for Certificate Path, if ($url) is used for exactly the same scenarioif ($Url)
{
Write-Information-Message 'Connecting with Service Principal - Path'Write-Information-Message "URL: $Url"Write-Information-Message "ConnectionUrl: $($Global:MSCloudLoginConnectionProfile.PnP.ConnectionUrl)"Connect-PnPOnline-Url $Global:MSCloudLoginConnectionProfile.PnP.ConnectionUrl`-ClientId $Global:MSCloudLoginConnectionProfile.PnP.ApplicationId`-Tenant $Global:MSCloudLoginConnectionProfile.PnP.TenantId`-CertificatePassword $Global:MSCloudLoginConnectionProfile.PnP.CertificatePassword`-CertificatePath $Global:MSCloudLoginConnectionProfile.PnP.CertificatePath`-AzureEnvironment $Global:MSCloudLoginConnectionProfile.PnP.PnPAzureEnvironment
}
else
{
Write-Information-Message 'Connecting with Service Principal - Path'Write-Information-Message "URL: $Url"Write-Information-Message "AdminUrl: $($Global:MSCloudLoginConnectionProfile.PnP.AdminUrl)"Connect-PnPOnline-Url $Global:MSCloudLoginConnectionProfile.PnP.AdminUrl`-ClientId $Global:MSCloudLoginConnectionProfile.PnP.ApplicationId`-Tenant $Global:MSCloudLoginConnectionProfile.PnP.TenantId`-CertificatePassword $Global:MSCloudLoginConnectionProfile.PnP.CertificatePassword`-CertificatePath $Global:MSCloudLoginConnectionProfile.PnP.CertificatePath`-AzureEnvironment $Global:MSCloudLoginConnectionProfile.PnP.PnPAzureEnvironment
}
$Global:MSCloudLoginConnectionProfile.PnP.ConnectedDateTime= [System.DateTime]::Now.ToString()
$Global:MSCloudLoginConnectionProfile.PnP.MultiFactorAuthentication=$false$Global:MSCloudLoginConnectionProfile.PnP.Connected=$true
}
Suggestion
For ServicePrincipalWithThumbprint, change from
if (-not$Url)
{..}
to
if ($Url)
{..}
The text was updated successfully, but these errors were encountered:
Note: this issue will be resolved in a PR coming shortly.
Problem
In PnP.psm1, for
ServicePrincipalWithThumbprint
the complete opposite ofServicePrincipalWithPath
is used in theif
-statement. The two should be identical. See my comments starting with# ====> ....
Suggestion
For
ServicePrincipalWithThumbprint
, change fromto
The text was updated successfully, but these errors were encountered: