I'm using the Connect-MgGraph command with my Client ID and Tenant ID for authentication, but I've run into an issue. After the first time I logged in, it doesn't prompt me for my credentials anymore and automatically logs me in every time I run the command. I want it to ask for my email and password each time I connect. I know that using Disconnect-MgGraph will prompt me for a username if the session is active, but if I close the shell session and reopen it, I can still connect without any authentication. How can I make it prompt me to sign in every time?
2 Answers
Try using the command Connect-MgGraph -ContextScope Process. This will help you bypass the Windows Authentication Manager (WAM), which is caching your credentials. This is great if you're juggling multiple sessions or clients. You can also set this as the default with PSDefaultParameters.
You could just use Connect-MgGraph without any extra options. But given that you're using both ClientId and TenantId, it seems like you're connecting to a different tenant than your logged-in user, so this might not work for your situation.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically