Microsoft365DSC icon indicating copy to clipboard operation
Microsoft365DSC copied to clipboard

Multiple MFA prompts when extracting SP Sites Property Bags

Open hbagarich opened this issue 6 years ago • 7 comments

Details of the scenario you tried and the problem that is occurring

I am running Export-O365Configuration using Global Account with Multi Factor Authentication activated. When the cmdlet comes to the part of extracting the SharePoint Site Property Bags it prompts for the credentials 16 times. The messages says it broke extraction into 16 jobs of 2 items each so I guess this is the problem. When I input the credentials everything works, but it is difficult to use this way

Verbose logs showing the problem

Suggested solution to the issue

It would be great if the user is prompted for credentials only at the start of the load. If the user needs to be prompted at this point, it should be once before these jobs begin.

The DSC configuration that is used to reproduce the issue (as detailed as possible)

# insert configuration here

The operating system the target node is running

OsName : Microsoft Windows 10 Enterprise OsOperatingSystemSKU : EnterpriseEdition OsArchitecture : 64-bit WindowsVersion : 1903 WindowsBuildLabEx : 18362.1.amd64fre.19h1_release.190318-1202 OsLanguage : en-US OsMuiLanguages : {en-US, hr-HR}

Version of the DSC module that was used ('dev' if using current dev branch)

dev

hbagarich avatar Dec 09 '19 16:12 hbagarich

This is definitively related to the multi-threading support in this resource. @brianlala we will need to investigate how to pass in token to the Test-MSCloudLogin function if a new O365 thread is generated when a user is already MFA connected to a workload.

NikCharlebois avatar Dec 17 '19 00:12 NikCharlebois

OK let me ponder for a bit...!

brianlala avatar Dec 17 '19 21:12 brianlala

@NikCharlebois I'm still here to test. :-)

wheelerk avatar Jan 15 '20 20:01 wheelerk

I did some testing on this, and the problem is in PnP PowerShell. It has a static property Connection which is lost when the Start-Job is run. I tried reusing Connection but would fail to authenticate to PnP.

hbagarich avatar Jan 17 '20 08:01 hbagarich

We are currently investigating using ServicePrincipal for SPO extraction which would get around having to do the MFA challenge. Stay tuned

NikCharlebois avatar May 04 '20 23:05 NikCharlebois

@desmay can you investigate to check if this is still an issue with SPO when using MFA enabled credentials? Thanks

NikCharlebois avatar Oct 01 '20 18:10 NikCharlebois

This was fixed with a recent release of MSCloudLoginAssistant

NikCharlebois avatar Dec 21 '21 14:12 NikCharlebois