title: How do I add audiences to JWTBearerAuthenticationOptions as they are created?
body: <p>I am in the process of securing my public api using oauth2 and jwt tokens.  I have the auth server configured to issue jwt tokens but I am struggling with the implementation of the 'ConfigureOAuthTokenConsumption' method.  </p>
  
  <p>This code closely resembles the code I am using at the moment, for reference:</p>
  
  <pre><code>private static void ConfigureOAuthTokenConsumption(IAppBuilder app)
  {
      var issuer = _baseUrl; // The URL of the service issuing the JWT Token. 
      var audienceRepo = ActiveKernel.Get&lt;IAudienceRepo&gt;();
      var validAudiences = audienceRepo.Get();
  
      List&lt;string&gt; allowedAudienceIds = new List&lt;string&gt;();
      List&lt;IIssuerSecurityTokenProvider&gt; providers = new List&lt;IIssuerSecurityTokenProvider&gt;();
  
      // Build the list of valid audiences and keys
      foreach (var validAudience in validAudiences)
      {
          allowedAudienceIds.Add(validAudience.ClientId.ToString().ToUpper());
          providers.Add(new SymmetricKeyIssuerSecurityTokenProvider(issuer, TextEncodings.Base64Url.Decode(validAudience.ClientSecret)));
      }
  
  
  
      // Api controllers with an[Authorize] attribute will be validated with JWT
      app.UseJwtBearerAuthentication(
          new JwtBearerAuthenticationOptions
          {
              AuthenticationMode = AuthenticationMode.Active,
              AllowedAudiences = allowedAudienceIds.ToArray(),
              IssuerSecurityTokenProviders = providers.ToArray()
          });
  }
  </code></pre>
  
  <p>In this method I am loading all of my audiences and this works great for established audiences.  If a new audience is registered on my server they will not have access until the application is restarted. </p>
  
  <p>How can I add audiences to the JWTBearerAuthenticationOptions as they are created?</p>