pnp/PnP

Core.ProfilePictureUploader - Error (Parameter name: cookieHeader)

Wee-Tommy opened this issue · 10 comments

Hi,

An error has started to appear using the sharepoint profile picture uploader.
Core.ProfilePictureUploader

Category

[X] Bug
[ ] Enhancement

Environment

[X] Office 365 / SharePoint Online
[ ] SharePoint 2016
[ ] SharePoint 2013

This was working up until a few weeks ago.
This is the error that is being generated:

25/09/2018 12:07:13 : Initializing SPO web service https://-admin.sharepoint.com/_vti_bin/userprofileservice.asmx
25/09/2018 12:07:13 : Error initiating connection to profile web service in SPO Value cannot be null.
Parameter name: cookieHeader
25/09/2018 12:07:13 : Processing finished for 0 user profiles (or so)
25/09/2018 12:07:37 : Initializing SPO web service https://
-admin.sharepoint.com/_vti_bin/userprofileservice.asmx
25/09/2018 12:09:48 : Initializing SPO web service https://****-admin.sharepoint.com/_vti_bin/userprofileservice.asmx

Thanks for any help you can provide.
Mark.

I am having the same issue. Have you found a solution?

Hi there.

Yeah. It's not a full solution but the cause of the issue was that we disabled legacy authentication protocols on our tenant. (Set-SPOTenant -LegacyAuthProtocolsEnabled $false)
This seems to have stopped the uploader working.
I reverted this back to true and tested and it started working again.

It seems to be because the picture profile uploader does not support modern authentication.
If this could be modified to support modern authentication it would be great and solve all the issues.

Another powershell plugin for Sharepoint online i've used is the PnP (https://docs.microsoft.com/en-us/sharepoint/dev/community/community). This is great for recycle bin scripts.
This also stopped working due to disabling legacy authentication protocols but found out it actually supports modern authentication via a switch
(Connect-PnPOnline -Url https://abcde.sharepoint.com/sites/testsite -UseWebLogin).

Thanks,
Mark.

Strange, I set mine to true and I still get the same error.

Hi,
Did you leave it for a few hours or try it straight away?
https://www.koskila.net/how-to-fix-the-web-site-does-not-support-sharepoint-online-credentials-the-response-status-code-is-unauthorized-error/
That is the article i read, he said he left overnight... however mine worked after a few hours.
There is also 2 powershell commands he says about.
Thanks,
Mark.

overnight but I'll try again. Still get cookieHeader error.

That's really weird!
You could try this as another test?
http://www.farookkhan.com/2018/01/sharepoint-powershell-restore-recycle-bin/

With legacy authentication protocols disabled i couldn't use this PS module.
With it enabled again i could.

However if you disable legacy auth you can still use these modules by putting the switch at the end -UseWebLogin which forces it to use modern authentication.

Nothing in bin to restore and adding -UseWebLogin made no change. I'll try again tomorrow but so far still getting the cookieHeader error.

Is it possible your tenant name was incorrect?
I made the mistake by entering the full URL instead of the name, and got the exact same error message you mentioned.

After changing it to the correct tenant name, the script worked perfectly.

i have the same issue for bulk update profile pic, the script has been working fine until now.

Error initiating connection to profile web service in SPO Value cannot be null.
Parameter name: cookieHeader

I was able to resolve this by adding this code snippet underneath the section of ProfilePictureUploader.exe.config file.

<runtime>
	<AppContextSwitchOverrides value="Switch.System.Net.DontEnableSchUseStrongCrypto=false" />
</runtime>