title: how to determine which group a user is a member of in azure active directory
body: <p>I'm using azure active directory to control user access to my web app.  This all works well, but I cant figure out how to identify which group the currently logged in user is a member of.   In ClaimsIdentity I can see both groups setup in azure, but I cant determine which one of these groups the user is a member of (they will only belong to 1 of 2 groups).  I have this code and also a key in my web.config that matches the key of my admin user, but both of my groups are in the claimsidentity object.  So how can I determine if this user is in my admin group ?</p>
  
  <pre><code>var groups = identity.Claims.Where(x =&gt; x.Type.Equals("groups")).ToList();
          //this is a GUID that should match the group objectID for Adminusers in the azure active directory
          string admin = Helpers.Settings.AdminUser;
          if (groups.Any(c =&gt; c.Value.Contains(admin)))
          {
              return true;
          }
          else
          {
              return false;
          }
  </code></pre>
  
  <p>I must be going about this the wrong way, anyone help me out ?</p>