Allowing unauthenticated Users to Access Oath routes in Laravel Passport

146 Views Asked by At

I am making a Laravel application which will be issuing bearer token using Laravel Passport. So the idea is that a client who wants to use our system will come and register and create the Client_Secret and the Client_ID, then upon creating these oath clients credentials the client will then take these credentials and integrate them in his application. Now here is the problem, upon the client integrating the Client_ID and the Client_Secret in his application I want him to use those credentials to request the authorization code on the Laravel system and make the bearer token (using his own app), now according to Laravel documentation on Laravel passport it says that the Oath API for making the authorization code and the bearer token is guarded by the web and Auth middleware; therefore, it may only be called from your own application. It is not able to be called from an external source. Does that mean that there is no way of allowing external users to access the oath routes of passports using their external applications? or is it ok to allow them make the bearer token on the Laravel system and taking that token to integrate them in their own app?

1

There are 1 best solutions below

0
On

the idea of this token from passport is to protect routes

when you can't use api request if the token in header not accept with you server

but when the token is accept with your server you can use it the api request from anywhere the simple example postman