title: Emit role's permissions as claims in JWT with AAD (Azure AD)
body: <p>I need to emit a role's permissions as claims in the JWT.</p>
  
  <p>The aim is to get a certain user's permissions as claims in the JWT for authorization purposes.</p>
  
  <p>The user belongs to a group which is assocciated to a certain role which has certain permissions in the Azure Active Directory.</p>
  
  <p>Clarification:
  If I add some items to the appRoles array in the app's manifest, the role names are emitted as role-type claims in the JWT in the following format:
  <a href="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" rel="nofollow noreferrer">http://schemas.microsoft.com/ws/2008/06/identity/claims/role</a>: [value property in the appRole item as appears int he manifest appRoles array]</p>
  
  <p>But I couldn't find any way to emit role's permissions' names (or any other property) as claims.</p>
  
  <p>I've been googling and digging in MS docs for days but couldn't find anything. I hope that it's possible.</p>
  
  <p>If it isn't possible, a clumsy workaround may be to represent the permission we need to be emitted as an AAD role, and to represent the role (in the meaning of "a set of permissions") as an AAD special group, and then to associate the groups we wanted to be associated with the role (in an ideal world) to that special "role"-group.</p>
  
  <p>But it's very clumsy as we will actually lose the natural meaning of role which is a set of permissions, and the natural meaning of group which is a set of users and/or groups</p>
  
  <p>Thanks for any help :)</p>