title: Azure AD Application Roles for Web Api
body: <p>I have secured a web api 2 project using Azure AD. This works perfectly well using the [Authorize] attribute, but I cannot get it to work with roles. I have added the following to the application manifest:</p>
  
  <pre><code>"appRoles": [
  {
    "allowedMemberTypes": [
      "Application"
    ],
    "description": "Access to example controller",
    "displayName": "Example",
    "id": "76d4bbb5-24c1-45ad-9446-cc360d7bd012",
    "isEnabled": "true",
    "origin": "Application",
    "value": "example"
  }
  </code></pre>
  
  <p>]</p>
  
  <p>and this attribute to my api controller: [Authorize(Roles="example")]. If I remove this attribute and call my api this claim is included for ClaimsPrincipal.Current:  </p>
  
  <pre><code>{http://schemas.microsoft.com/ws/2008/06/identity/claims/role: example}
  </code></pre>
  
  <p>but this isn't enough to allow my application to authenticate when the roles header is used. Any help would be appreciated.</p>