Extend the `m365 status` command with appId and tenant
See original GitHub issueWe should extend the output of the m365 status
command with information about the appId and tenant used in authentication.
We should extend the output from:
{
"connectedAs": "name"
}
to:
{
"connectedAs": "name",
"appId": "123",
"appTenant": "common"
}
Rationale
After experimenting with a custom AAD app, today, while trying to create an app reg using the CLI, I got an “Insufficient privileges to complete the operation” error. After scratching my head for a sec I realized, that it’s because the app reg I was using yesterday had no scopes for managing AAD apps. That’s not obvious when you check status, because it only shows the user or app name. Unless you know to check the token, it’s not trivial to figure out and is something that we should communicate more clearly.
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Cross-tenant mailbox migration - Microsoft 365 Enterprise
Administrators can use the New-MigrationBatch cmdlet, available through the Move Mailboxes management role, to execute cross-tenant moves. Users ...
Read more >Update command: m365 login, pass in --clientId and --tenantId ...
Allow to pass in clientId and tenantId as options to the m365 login command when using the certificate authentication option.
Read more >app set - CLI for Microsoft 365
If the command finds multiple Azure AD application registrations with the specified app name, it will prompt you to disambiguate which app it...
Read more >How to connect to delegated Office 365 tenants using ... - GCIT
Connect to delegated Office 365 tenants via PowerShell using the Secure App Model · 1. Create a new Azure AD Application with access...
Read more >Working with Azure AD schema extensions and Microsoft Graph
Tip: To get your own M365 tenant and a playground, ... Graph PowerShell commands to create the desired user schema extension.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What if we used not
isAppOnlyConnected
but rather show the value of theauthType
option that was used during login? It would not only allow you to determine if you’re using app-only or not but could possibly support other scenarios as well.Yes, we store the information along tokens. We’re serializing the instance of the Service class and have access to its properties https://github.com/pnp/cli-microsoft365/blob/1e08e6ce84efcbb4a65f1c96998588a5b3420a98/src/Auth.ts#L37-L51. You can get to it via
auth.service
.I think it’s a great and useful addition to always show 😊