Creds Variable password cleared before SPO Connect
chwilfing opened this issue · 4 comments
I've strange behaviour and just wanted to ask if it's my machine. I'm debugging the O365 data retriever within visual studio code (version 1.26.1) and when running in Debug mode sometimes not always but most of the time the password of the creds variable gets lost just before the SPO Connect. but it works three lines before with the connect to sfbosession. (see image for reference)
Result is the powershell asking for password
anybody else seeing that behaviour?
Hey @chwilfing, I recently had similar issues with VSCode where the PowerShell terminal would close unexpectedly, but no problem at all when running from the PS console or ISE.
Funny, I found the behaviour in other Powershell Modules described here.
If I trace the steps through I can exactly see that the password length of the credentials object is cleared (reset to 0) after the New-CSOnlineSession consumes the credential object. (Line 765)
Tested with a Newer Version of the ADAL Library (Microsoft.IdentityModel.Clients.ActiveDirectory.dll) with a manual import from the assemblies folder and this changed the behaviour. So I guess this an issue with my machine pulling the old Library Version with the Bug from GAC and killing the creds object after consuming with the New-CSOnlineSession Object. Just closing this comment and leaving in place for reference of other users maybe seeing the same behaviour.
Just to inform - as i found the solution. The MSOnline Powershell does have a version 1.1.183.8 - which has the old ADAL Library. updating this with
update-module MSonline
from Powershell Gallery to version 1.1.183.17 does fix the issue and brings the new ADAL Library Version 3.19.xxx
Full honesty, the ADAL library is also part of the current SkypeOnline Powershell. The ADAL lib contained has the version 3.16.xxx which contains the same Bug. If the library is manually changed to version 3.19 (from the msonline module for example) the bug disappears too.