microsoft/poshtools

[Remote Debugging] Double Authentication Prompting

MrayerMSFT opened this issue · 2 comments

While attaching to a remote processes a user must enter their credentials twice. Once when getting a list of processes, and again while attaching. This is because we must exit the remote session after enumerating all of the processes because we don't know what the user is going to do next. We should either:

  1. Talk to VS people and see if there is a way to catch the user hitting cancel on the attach window
  2. Provide a secondary transport which does not authentication prompt, this will make it quicker for people who can remote session w/o authentication

Let me find you some contact from VS debugging to answer the question #1 above.

I was half way of typing the email to ask some VS debugging expert about how to catch the case of use exits from attach dialog, suddenly realized there might be another way around to avoid double auth, which should be better in my perspective:
During enumeration of the remote process, instead of directly enter-pssession, we use Get-Credential to prompt user for user/pwd, then feed the cred into enter-pssession, after getting all processes info, we go ahead to close the remote session, but with $cred on hand, then if things work fine user decided to continue on attaching one of the processes, we use the $cred to establish the remote session again.