Background
I am trying to develop a multi-tenant SaaS application. I am trying Admin Consent model of authorization. However, I am not able to figure out scoped destination i.e how to limit ourselves to a specific group of users in an enterprise rather than all users.
I believe that not all enterprises might want us to handle all users in the beginning.
Description
I am using a client_credentials
grant for authentication.
The app is meant to read a user's drive data.
Set of permissions that I am asking are:
Files.Read.All
Users.Read.All
Sites.Read.All
When I ask a global admin to grant required permissions i.e, redirecting to
https://login.microsoftonline.com/common/adminconsent?client_id=[my_client_id]&state=12345&redirect_uri=[my_redirect_uri]
As soon as the admin consents to the permission, it is for all the users under that tenant. This is a highly unacceptable situation for an enterprise O365 admin where he/she exposes the entire user's/drive-file's details.
Is there a way where admin consents on behalf of a particular set/group of users?
Note: Only admins are allowed to consent. I have got suggestions to use Security groups or creating Service account. Please give some pointers if they are applicable for my use case.