title: AADSTS50013: Assertion contains an invalid signature. Reason - The key was not found.,
body: <p>I'm trying to setup an Azure Function with Azure AD B2C. The functions require authorization tied to an Azure AD B2C application.</p>
  
  <p>The Azure AD B2C application has a keys section:</p>
  
  <p><a href="https://i.stack.imgur.com/JztP2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JztP2.png" alt="enter image description here"></a></p>
  
  <p>I used the generated key (M99*****) and put it in the azure functions authentication/authorization settings:</p>
  
  <p><a href="https://i.stack.imgur.com/ZzmNK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZzmNK.png" alt="enter image description here"></a></p>
  
  <p>When I call the function passing in the correct bearers key:</p>
  
  <pre><code>[FunctionName("TestMe")]
  public static IActionResult Run([
      HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequest req, 
      [Token(Resource="https://graph.microsoft.com", Identity=TokenIdentityMode.UserFromRequest)]string graphToken,
      TraceWriter log)
  {
  </code></pre>
  
  <p>I'm not sure what's going on at this poiint other than I'm using the wrong secret key, which begs the quesiton - in Azure AD B2C what is the correct key?</p>