title: How to get client id and client secret dynamically from request header?
body: <p>I'm trying to get client id and client secret dynamicaly without passing string parameter of <code>&quot;xyzClientId&quot;</code> and <code>&quot;xyzClientSecret&quot;</code></p>
  <pre><code>public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
          {            
  
              bool isTenantForbidden = false;
  
              var headers = context.HttpContext.Request.Headers;
              headers.Add(&quot;xyzClientId&quot;, &quot;someclientId&quot;);
              headers.Add(&quot;xyzClientSecret&quot;, &quot;someClientSecret&quot;);           
  
              headers.TryGetValue(&quot;xyzClientId&quot;, out var clientId);
              headers.TryGetValue(&quot;xyxClientSecret&quot;, out var clientSecret);
  
              var tenant = this.tenantService.GetTenant(clientId, clientSecret);
              
              isTenantForbidden = await this.ForbidTenant(tenant);            
  
              if (isTenantForbidden)
              {
                  throw new Exception(&quot;Restricted resource!&quot;);
              }
  
              await next();
          }
  </code></pre>
  <p>How I get these access informations like getting Bearer token:</p>
  <pre><code>context.HttpContext.Request.Headers.TryGetValue(&quot;Authorization&quot;, out authorizationToken);
  </code></pre>