Let only specific roles to access specific routes Python Flask

I’m new to auth0 and I have a website built with flask, one of the functions of the site is creating posts, and I want that only specific roles like admin could access that route (I already made the admin role in the dashboard and gave it permissions).
I asked a friend who uses auth0 and angular and he told me he uses a function called AuthGuard, and I wanted to know if there is an equivalent to this func in python?

Hello Eliya,

We have this documented here: Python API: Authorization#protect-api-endpoints

As you can see in the example, the /api/private-scoped route is available for authenticated requests containing an Access Token with the read:messages scope granted.

Note that to get the scopes, you will need to pass the audience of your API.

Please let me know if you have follow-up questions.

Thanks,
Art

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.