title: Blazor Authentication with Azure AD - Retrieving User Roles
body: <p>I've successfully setup a Blazor application to authenticate with the Azure tenant where I work.  The authentication works beautifully.  I have the App Registration setup in Azure with appRoles defined in the manifest.  I've add a few users to the application with those roles assigned however I'm not getting any Role claims back on the user context after it authenticates.</p>
  
  <p>Startup.cs</p>
  
  <pre><code>services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
                  .AddAzureAD(options =&gt; Configuration.Bind("AzureAd", options));
  
  
          services.AddControllersWithViews(options =&gt;
          {
              var policy = new AuthorizationPolicyBuilder()
                  .RequireAuthenticatedUser()
                  .Build();
              options.Filters.Add(new AuthorizeFilter(policy));
  
          });
  </code></pre>
  
  <p>Manifest:</p>
  
  <pre><code>"appRoles": [
      {
          "allowedMemberTypes": [
              "User"
          ],
          "description": "Coming soon.",
          "displayName": "Viewer",
          "id": "{guid goes here}",
          "isEnabled": true,
          "lang": null,
          "origin": "Application",
          "value": "Viewer"
      },
      {
          "allowedMemberTypes": [
              "User"
          ],
          "description": "Coming soon.",
          "displayName": "Manager",
          "id": "{guid goes here}",
          "isEnabled": true,
          "lang": null,
          "origin": "Application",
          "value": "Manager"
      }
  ],
  </code></pre>
  
  <p>I'm trying to retrieve those roles with the claims after authentication, but no roles are coming through.  This is obviously making IsInRole not work and for the life of me I can't find any samples of code to achieve this.  </p>
  
  <p>I would greatly appreciate it if someone could point me in the right direction!</p>