microsoftgraph / msgraph-cli-archived

The Microsoft Graph CLI repository has moved. This repository is now an archive.
https://github.com/microsoftgraph/msgraph-cli
Other
44 stars 9 forks source link

`--scopes` should be optional on `mg login` #125

Closed peombwa closed 3 years ago

peombwa commented 3 years ago

Describe the bug --scopes should be optional since consented scopes are attached to an application after the first auth consent by Microsoft Identity Platform. Customers should be able to use mg login, minus --scopes, and still be authenticated using the scopes they had previously consent to. --scopes should ideally be used for incremental scope consent.

Microsoft Identity Platform will always return previously consented scopes whenever you authenticate. The example below shows this in action:

Example

I only requested user.read yet Identity returned all the scopes I had previously consented to for this application: image

To Reproduce Steps to reproduce the behavior:

  1. Run mg login.
  2. You get the following error mg login: error: the following arguments are required: --scopes,

Expected behavior mg login should authenticate me using the scopes I had previously consent to. This is the same behavior for Connect-MgGraph in PowerShell.

Screenshots image

Additional context