MSAL popup: Is it possible to display only the users from that specific tenant

77 Views Asked by At

I've used domain_hint: "example.com" and it does list the accounts that match that domain but is there a way to list all the accounts under the provided tenant ID?

1

There are 1 best solutions below

0
On

You can list all users in your tenant using MS Graph.

Please go through MS Document.

For example below java script will return all users of particular tenant,

const options = {
    authProvider,
};

const client = Client.init(options);

let res = await client.api('/users').get();

Make sure your MSAL token contains minimum User.ReadBasic.All permission to achieve this.