# OnAuthorization doesnt have claims

**URL:** <https://community.auth0.com/t/onauthorization-doesnt-have-claims/8753>\
**Category:** Get Help\
**Tags:** api-authorization, claims, api-access\_token\
**Created:** [November 15, 2017, 5:43pm UTC](https://community.auth0.com/t/onauthorization-doesnt-have-claims/8753 "2017-11-15T17:43:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![afleveri](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@afleveri](https://community.auth0.com/u/afleveri)\
**Post date:** [November 15, 2017, 5:43pm UTC](https://community.auth0.com/t/onauthorization-doesnt-have-claims/8753/1 "2017-11-15T17:43:49Z")

</div>

Hi,

When I get my token with scopes, method OnAuthorization doesnt receive the token with scopee, What am I doing wrong? :

```
public override void OnAuthorization(HttpActionContext actionContext)
        {
            base.OnAuthorization(actionContext);

            ClaimsPrincipal principal = actionContext.ControllerContext.RequestContext.Principal as ClaimsPrincipal;
            if (principal != null)
            {
                // If user does not have the scope claim, get out of here
                if (principal.HasClaim(c => c.Type == "scope"))
                {

                    // Split the scopes string into an array
                    var scopes = principal.Claims.FirstOrDefault(c => c.Type == "scope").Value.Split(' ');

                    // Succeed if the scope array contains the required scope
                    if (scopes.Any(s => s == scope))
                        return;
                }
            }

            HandleUnauthorizedRequest(actionContext);
        }

```

---

<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:57am UTC](https://community.auth0.com/t/onauthorization-doesnt-have-claims/8753/2 "2018-03-02T05:57:25Z")

</div>


