Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Et4n's avatar
Level 1

Passport - Scope and Gate/Policy

Hello,

I use Gate/Policies to manage permissions for users. However I also need to access some data through clients_credentials with scopes.

The resource I need to access is behind a route already protected by Policy but I would like to access it also with a token generated through client_credentials with scope 'read-something'

is it possible ? Would adding the scope's middleware with the right scope sufficient (so I would request with a token that has the scope read-something) ? Will the policy blocks the request ?

Or do I need to add scope by checking user's role and only use scope ?

Any hint is very much appreciated.

Thanks :)

0 likes
0 replies

Please or to participate in this conversation.