# Web API + Authorisation

**URL:** <https://community.auth0.com/t/web-api-authorisation/7368>\
**Category:** Get Help\
**Tags:** webapi\
**Created:** [July 3, 2017, 11:57am UTC](https://community.auth0.com/t/web-api-authorisation/7368 "2017-07-03T11:57:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronak.sharma](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ronak.sharma/32/12835_2.png) [@ronak.sharma](https://community.auth0.com/u/ronak.sharma)\
**Post date:** [July 3, 2017, 11:57am UTC](https://community.auth0.com/t/web-api-authorisation/7368/1 "2017-07-03T11:57:18Z")

</div>

I got access\_token from Auth0 which contains roles and groups. But when passing same access\_token to call web-api’s. I am not getting groups and roles claims.

I had use below code to decorate my web-api method

> [Authorize(Roles = “Admin”)]

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 6, 2017, 6:53pm UTC](https://community.auth0.com/t/web-api-authorisation/7368/2 "2017-07-06T18:53:38Z")

</div>

That will depend on how the token is being processed when it’s received by the (assuming [ASP.NET](http://ASP.NET)) Web API. If the processing includes the creation of a `ClaimsIdentity` which is highly likely then if you can influence how that identity is created, one of the [constructor of that class](https://msdn.microsoft.com/en-us/library/hh194484(v=vs.110).aspx) allows to specify which claim type will be treated as source of roles information. This should allow you to specify the claim that carries your roles and the attribute should then apply the logic based on information carried in the custom claim type.

There may be other extensibility points that could be used to signal that roles are coming from a specific claim type instead of the default one assumed by .NET, however, that will always depend on how exactly the token is being processed and you did not provide any information about this part of the process.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/web-api-authorisation/7368/3 "2018-03-02T05:55:08Z")

</div>


