title: How to Integrate Azure AD authentication with custom Role store in .net core mvc?
body: <p>I have web application created with .net core mvc, and enabled azure AD authentication and , has postgress database with roles and user table.</p>
  <p><code>Startup.cs</code> is as bellow</p>
  <pre><code>public void ConfigureServices(IServiceCollection services)
      {
          services.AddAuthentication(AzureADDefaults.AuthenticationScheme)
              .AddAzureAD(options =&gt; Configuration.Bind(&quot;AzureAd&quot;, options));
  
          ValidateToken(services);
  
          services.AddControllersWithViews(options =&gt;
          {
              var policy = new AuthorizationPolicyBuilder()
                  .RequireAuthenticatedUser()
                  .Build();
              options.Filters.Add(new AuthorizeFilter(policy));
          });
  
          services.AddRazorPages();
  
          //ConfigureElsa(services);
  
          ConfigureDatabaseContext(services);
          ConfigurePolicies(services);
          ConfigureHandlers(services);
      }
  </code></pre>
  <p>I have registered app in azure portal and all is working fine.</p>
  <p>I need to know how to integrate this with my existing database <strong>roles</strong>.</p>
  <p>Does anyone can help me?</p>
  <p>Thanks</p>