Which Laravel Passport Grant Type is perfect for 3rd Party server accessing my application resources using an API?

Basically, I would like to give 3rd Party (few X companies) access to my resources using an API and I would like to know which Grant Type would be best suitable and why?

I have already implemented “Client Credential Grant Type” which seemed perfect as it is best used for Machine to Machine interaction and that’s what I wanted to do, that is, give 3rd Party Company access using an API to fetch and send data, but the problem with this Grant Type is that, I am unable to make a link with Users Table because there is no user_id. so, It is not possible for me to keep track of which X company is sending or fetching data. Which makes me question if I am using the right Grant Type?

I have already followed first few steps from Laravel Passport Documentation (https://laravel.com/docs/7.x/passport) to setup Passport in my application and everything seems to be good.

Steps Followed

1. composer require laravel/passport
2. php artisan migrate
3. php artisan passport:install
4. add the LaravelPassportHasApiTokens trait to your AppUser model.
5. call the Passport::routes method within the boot method of your AuthServiceProvider
6. Finally, in your config/auth.php configuration file, you should set the driver option of the api authentication guard to passport.

There are 4 types of clients:

1. php artisan passport:client --public   (for SPA or JS application)
2. php artisan passport:client --client (for machine to machine)
3. php artisan passport:client --personal (for mobile applications)
4. php artisan passport:client --password (outdated)

Which is the right passport:client? and how to implement it?

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/2VTvn2l
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.