U
U
Urbansamurai2017-02-06 14:30:20
OAuth
Urbansamurai, 2017-02-06 14:30:20

How to correctly differentiate access for paid/free users in Laravel Passport?

Help please deal with the problem. I have 3 categories of users: not logged in, logged in but with a free subscription and logged in with a paid one. I'm using OAuth2 authentication and accessing a resource via an api route secured with Laravel Passport.
Thus, if a user visits the site for the first time, he immediately receives a token from the server, which opens access to the free part of the resource (the path to which is the same for everyone).
The problem is that if you use client_credentials, then I cannot specify a separate scope for a client_id specially created for it. And using 2 middleware auth:api and client_credentials at the same time to access the resource does not work, in this case auth:api takes over.
A slightly confusing topic, I seem to have studied the subject, but there are still a lot of ambiguities.
I have the front on Vue, and the back separately on Laravel.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question