title: Jwt with new client
body: <p>I have implemented JWT auth</p>
  
  <p>I have function in startup file like</p>
  
  <pre><code>public void ConfigureOAuth(IAppBuilder app)
          {
              var issuer = "http://jwtauthzsrv.azurewebsites.net";
              //var audience = "fd9eeeb25b694ff1bfd2260cf0d665c3";
              //var secret = TextEncodings.Base64Url.Decode("ixioSD5UPMMfGFUvxfblU3elZAnUvtoleVI0qu_7SrI");
              List&lt;string&gt; secret = new List&lt;string&gt;();
              List&lt;string&gt; audience = new List&lt;string&gt;();
  
              secret.Add(Convert.ToBase64String(TextEncodings.Base64Url.Decode("adFu3IhHjNibtVzy7Uon7l9CQE97XQ8YOKnLzLWlb1s")));
              //secret.Add(Convert.ToBase64String(TextEncodings.Base64Url.Decode("YqnwwJFI6HTQheAGvHI9ycuhgRmkpJDgOQDkDnahG2I")));
              // secretkeys.Add(TextEncodings.Base64Url.Decode("YqnwwJFI6HTQheAGvHI9ycuhgRmkpJDgOQDkDnahG2I").ToString());
              audience.Add("746b0e9e0bb44bfda086bc7f03f427c5");
             // audience.Add("7ef27cd3397d41e4848c3a85cca9e737");
  
  
  
  
  
              // Api controllers with an [Authorize] attribute will be validated with JWT
              app.UseJwtBearerAuthentication(
                  new JwtBearerAuthenticationOptions
                  {
                      AuthenticationMode = AuthenticationMode.Active,
                      AllowedAudiences =  audience.AsEnumerable(),//new[] { audience },
                      //AllowedAudiences = new[] { audience },
                      IssuerSecurityTokenProviders = new IIssuerSecurityTokenProvider[]
                      {
                          new SymmetricKeyIssuerSecurityTokenProvider(issuer, secret)
                          //new SymmetricKeyIssuerSecurityTokenProvider(issuer,secret.AsEnumerable())
                      },
                      Provider = new OAuthBearerAuthenticationProvider
                      {
                          OnValidateIdentity = context =&gt;
                          {
                              context.Ticket.Identity.AddClaim(new System.Security.Claims.Claim("newCustomClaim", "newValue"));
                              return Task.FromResult&lt;object&gt;(null);
                          }
                      }
                  });
  
          }
  </code></pre>
  
  <p>I assume whenever an api with <strong>authorize</strong> attribue is being called it should call <code>ConfigureOAuth</code> so that it should load all cient id from database and validate through jwt, but while debugging I saw startup file runs only when I run the application, </p>
  
  <p>How can I make this to call <code>ConfigureOAuth</code> this function whenever any api getting called, so that it should load new clientid as well and validate.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <pre><code>app.UseJwtBearerAuthentication(
                  new JwtBearerAuthenticationOptions
                  {
                      AuthenticationMode = AuthenticationMode.Active,
                      AllowedAudiences =  select from database),
  </code></pre>
  
  <p>the above line is being initialized only once when I publish and deploy project, but not when a new api call is being made.</p>
  
  <p>Problem occurring if a new user has been created, the id of new user is not coming in allowed audiences</p>
  
  <p>Thanks</p>