# Problem with setting up auth0-authorization-extension-api

**URL:** <https://community.auth0.com/t/problem-with-setting-up-auth0-authorization-extension-api/7728>\
**Category:** Get Help\
**Tags:** python, api-authorization, authorization-extens, authentication, auth0\
**Created:** [August 3, 2017, 1:08am UTC](https://community.auth0.com/t/problem-with-setting-up-auth0-authorization-extension-api/7728 "2017-08-03T01:08:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![huseyin](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@huseyin](https://community.auth0.com/u/huseyin)\
**Post date:** [August 3, 2017, 1:08am UTC](https://community.auth0.com/t/problem-with-setting-up-auth0-authorization-extension-api/7728/1 "2017-08-03T01:08:30Z")

</div>

Hi,

I want to setup authorization mechanism to my python flask application. I want o manipulate authorization of groups, users and etc… in my application.

After reading through these pages about how to setup authorization through extension

1-[Authorization Code Flow - Auth0 Docs](https://auth0.com/docs/api-auth/grant/authorization-code)

2-[Flask API - Auth0 Docs](https://auth0.com/docs/quickstart/backend/python#add-api-authorization)

I added this decorator which is shown in the second link above (interesting thing is that I realized 2nd links decorator has the same decorator names with the [00-Starter-Seed](https://github.com/auth0-samples/auth0-python-web-app/tree/master/00-Starter-Seed) app. So 2nd links decorator does authorization and authentication at the same time ?

`def requires_auth(f): .. .. .. `  
But when I tried to work that decorator, I am getting this error

```
{
  "code": "Error decoding token headers.", 
  "description": "Invalid header. Use an RS256 signed JWT Access Token"
}

```

I doubted from maybe I understand the concept of implementing authorization in Auht0 wrong. So, what I understand from it is

1 - check needs to be made to determine whether the incoming request contains valid authorization information (jwt)

2- get `access_token` and use it in decorator

3-call the api to manipulate groups, users, etc, … (things I want to do through api) OR use it as function decorator to make use that function only be called by admin

what is the point I am not seeing or understanding wrong ?

Thanks  
Huseyin

---

<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/problem-with-setting-up-auth0-authorization-extension-api/7728/2 "2018-03-02T05:55:43Z")

</div>


