msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Connect-MgGraph: support native login flow similat to Connect-ExchangeOnline

Open serkonda7 opened this issue 10 months ago • 6 comments

Is your feature request related to a problem? Please describe the problem.

The browser login flow requires me to always logout from the browser manually afterwards.

Describe the solution you'd like.

Connect-ExchangeOnline opens a native login window, I would prefer this to the browser flow. For compatibility, this could be available with a flag.

Additional context?

No response

serkonda7 avatar Feb 21 '25 14:02 serkonda7

Hi @serkonda7 do you mean that when you run Disconnect-MgGraph command it redirects you to a browser where you are required to logout?

timayabi2020 avatar Feb 21 '25 15:02 timayabi2020

No, what he is referring to is when connecting to the Graph Powershell module it opens your default browser for authentication vs when using the ExchangeOnline module it opens in a native browser window. This is helpful when you are connecting to multiple tenants you don't have to worry about logging into the wrong tenant or adding that tenant to your browser cache.

ryanchrisw avatar Feb 21 '25 21:02 ryanchrisw

No, what he is referring to is when connecting to the Graph Powershell module it opens your default browser for authentication vs when using the ExchangeOnline module it opens in a native browser window. This is helpful when you are connecting to multiple tenants you don't have to worry about logging into the wrong tenant or adding that tenant to your browser cache.

@timayabi2020 I mean exactly this ^^

serkonda7 avatar Feb 24 '25 14:02 serkonda7

I agree, FWIW.

12Knocksinna avatar Feb 24 '25 18:02 12Knocksinna

@serkonda7 @ryanchrisw I think you can make use of Connect-MgGraph -UseDeviceCode which bypasses any pre-signed browser sessions by forcing a manual code entry process.

Connect-MgGraph -TenantId "<Tenant-ID>" can also work

timayabi2020 avatar Feb 26 '25 04:02 timayabi2020

@timayabi2020 your suggestions could indeed work. But one might expect some consistency across products

serkonda7 avatar Mar 02 '25 14:03 serkonda7