Vue.js Todo App - Laravel Passport - Part 9
Why Stack Overflow recommends it
Stack Overflow users link it when setting up Laravel Passport login for a Vue front end, especially the pattern of hiding the client secret behind a server-side Guzzle call.
Recommended by 1 people across 1 different months, 2018 to 2020.
What it is
Part 9 of Andre Madarang's Vue.js Todo App series, where he builds the authentication layer using Laravel Passport's password grant with token-based auth. He tests the login flow with the Insomnia REST client.
What people said
Recommends Belahcel Yanis · 2019-02 · Stack Overflow · on “Laravel 5.5 Passport client_secret and Vue JS Auth”
I faced the same problem and found an interesting solution. You can add a custom endpoint on the backend and make the request from there. All you have to do is to: First, create a route in the api.php file Route::post('/login', 'AuthController@login'); Then, create the AuthController and login function associated with that route php artisan make:controller AuthController Finally, install Guzzle, the HTTP client that will allow you to make a request from PHP composer require guzzlehttp/guzzle and make the request from the login function public function login(Request $request) { $http = new \GuzzleHttp\Client; try { $response = $http->post(' [LINK] ', [ 'form_params' => [ 'grant_type' => 'pass
Cites The Keeper · 2018-08 · Stack Overflow · on “Guzzle in laravel keeps loading, not returning values”
Im using Laravel passport for API authentication. I have two routes /api/login and /oauth/token Since I cannot hardcode my client id and the login receives from JS and the params and client id is hardcoded inside a login method(laravel), Im trying to post the values using Guzzle (6.0) to oauth/token (POST requests). I followed a youtube video and there it works but not mine. Iam using 5.6, not sure which version was in the video. Could someone help? Below is the Video [this video] Below is the code $http = new GuzzleHttp\Client(); $request = $http->post(URI, '/oauth/token', [ 'form_params' => [ 'username' => 'bar', 'password' => 'xxxxxx', 'client_id' => 2, 'grant_type' => 'password', 'client_secr
Cites dotNET · 2019-09 · Stack Overflow · on “Redirecting to local post route”
Short version Do we need GuzzleHttp to redirect to local POST route ? Can't we do this directly using redirect() ? Long version Following this Laravel tutorial [this video] about using Passport authentication, the presenter talks about a way of hiding client_id to increase security (check at around 11:45 in the video). The idea is to expose a new wrapper route that accepts only username and password fields and then the controller injects client_id on the server-side and makes a new call to Passport's original login route. This call is made using GuzzleHttp client. Response of the call is then returned by the wrapper route to the caller. My question is: Do we really need to install and use Guzzle?
Cites Rio Gosal · 2020-08 · Stack Overflow · on “Laravel Passport and Vue accompanied by Guzzle not returning token”
I'm using Laravel Passport to handle my oauth2 login implementation. Following videos from Dre Himself [this video] . Everything works fine when on localhost but had issues logging in the real site now I want to deploy my application to DigitalOcean, and after setting up nginx, .env file, composer, npm, setup passport (php artisan passport:install) and database using (php artisan migrate). It all seem to work fine until my login returned 200 with a response payload of <!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n\n <title>Resume Workshop</title>\n\n <!-- Fonts -->\n <link href=\" [LINK] " rel=\"