3

I have a SaaS system using Azure AD and multitenant access. This records the issuer, in the format https://sts.windows.net/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/ and an objectidentifier ID. The portal I'm using insists on seamless trials, so for trial users I can't show a box to collect emails etc. When people later sign up this is collected.

In the initial version I screwed up and didn't collect user names/emails addresses, so I can't warn such users their trials are terminating. I've now fixed this and record the Principal.Identity.Name, which contains an email, every initial sign on.

This leaves me with a bunch of people I have no emails for.

Using what I've got, and maybe powershell or the Graph API, how do I get the names/emails?

  • What permissions do you have on either Graph API? – juunas Jul 13 '18 at 07:35
  • I'm not sure I know what you mean. Because it's a multitenanted system using the /common endpoint, anyone with an azure ad tenant can log in. I've got their issuers and client IDs, id like to have their emails too. – Andy Edmonds Jul 13 '18 at 09:48
  • I mean what permissions does your app require on the Graph API? If you have the user's object id, you can query for them from there. But this is not possible with the default permission which only allows you to get the signed-in user's profile. – juunas Jul 13 '18 at 09:56
  • I have no permissions on someone else's tenant. However, all I want is information that is freely available when someone from another tenant logs in to my SaaS site. The question is if there is some alternate way to get this apart from waiting for users to log in? – Andy Edmonds Jul 13 '18 at 14:59
  • In order to query all users in the tenant you would need the permission to do that. If you don't have it, then you'd need them to log in. Remember that the user principal name isn't always an email though while it usually is. – juunas Jul 13 '18 at 15:07
  • You want to get users emails for all the users that your tenant and the related tenant? – SunnySun Oct 18 '18 at 07:45

0 Answers0