Symfony Api platform how test permissions and roles with auth0

Hello,

I have a question regarding Symfony API Platform and how with functional test permissions and roles when using Auth0 token (I am using the Auth0 PHP SDK to decode the token).

My approach to securing endpoints is to decode the permissions and roles using an authenticator when the API receives the Auth0 token.

What is the best rpactice to test my application ?
Create fake auth0 token for the test ? If yes how ?

Thanks!

Hi @kevin.schmitt.upjv

Regarding testing your API, I would recommend to review our documentation about Access Tokens and Token Best Practices.

For testing the tokens, I would recommend to create different users either via the Management API or the Auth0 Dashboard in order to test our their permissions, roles and scopes within your API.

If you have any other questions, feel free to leave a reply!

Kind Regards,
Nik

1 Like