Laravel Passport error when login, use together with Laravel Socialite - laravel

I'm building 2 apps which 1 for the OAuth by using Laravel Passport and another app is using the Laravel Socialite with the Provider from https://socialiteproviders.com/Laravel-Passport/
I have set up all the route and have ran passport:install
And at the second application, I have install Laravel Socialite with provider.
Provider settings are also set in config and .env file
But when I try to login, it show error as below, but I confirm that I can login normally using web in OAuth application
Client error: `POST http://localhost:8002/oauth/token` resulted in a `401 Unauthorized` response: {"error":"invalid_client","error_description":"Client authentication failed","message":"Client authentication failed"}
What am I missing? Any help is appreciated.

Related

laravel fortify sanctum SPA issues on forge

My setup is working properly locally but apparently I'm getting a 401 issue on laravel forge for my laravel-fortify-sanctum
basically I use laravel fortify for authentication then sanctum to get a token after authentication process.
it works properly on my local setup but in laravel forge it's saying I'm still Unaunthenticated
laravel forge domains
api.domain.com
frontend.domain.com
SESSION_DRIVER=cookie
SESSION_DOMAIN=.domain.com
SANCTUM_STATEFUL_DOMAINS=*.domain.com
Am I missing something?

Laravel Socialite Twitter Provider - Could not authenticate

I'm using Laravel Socialite in a project and added the Twitter Provider in order to be able to allow my users to integrate with their Twitter account. I followed the steps here https://socialiteproviders.com/Twitter/ and I'm getting the following error:
Received HTTP status code [401] with message "{"errors":[{"code":32,"message":"Could not authenticate you."}]}" when getting temporary credentials.
If I leave the TWITTER_REDIRECT_URI in my env file blank, the error goes away and the Oauth flow works exactly as it's supposed to. Is anyone else having this issue? If the TWITTER_REDIRECT_URI isn't needed why have it in the docs?

Using Laravel sanctum for Laravel default authentication returns 419 error code

I am using Laravel Sanctum for making authentication. I don't have any SPA application and I want to have Laravel Sanctum for having default authentication.
I have followed the documentation but I've got 419 error code.
If you try to logging to system with Cookie Base application you should add CSRF to your application. And you do not have to use Laravel/Sanctum package if you will not separate your application parts with wildcards. Just use sessions instead of it.

laravel socialite 3.0 getting error during Google+ login

laravel
Client error: GET https://www.googleapis.com/plus/v1/people/me?prettyPrint=false resulted in a 403 Forbidden response:
{"error":{"errors":[{"domain":"usageLimits","reason":"accessNotConfigured","message":"Project
892227784590 is not found (truncated...)
Make sure you've created an application in Google's console and also have your client id and client secret from google. Also make sure you've configured google option in your config/services.php.

Using Passport Oauth2 in server access token issue

Hello To All I'm facing problem for using passport Oauth2 Authentication in laravel 5.4, I am working on project where I define two routes
1. For login through API http://localhost:8000/api/login from Which, I got a response as Access Token.
2. Another for get user details http://localhost/api/user and I am getting the user details.
But When I deploy my App to server and try to Hit the above two URL in Postman I am getting the access token but While tried to access the user with the generated access token. It send me error of Unauthenticated.
Do I need to generate passport key in server with php artisan passport:keys
Yes you'll need the encryption keys on the server as well:
php artisan passport:keys
// or with new installations
php artisan passport:install
Also ensure you're using the correct auth guard, auth:api, when accessing the user:
// middleware
Route::group(['middleware' => ['auth:api'])->(...)
// and with the user helper
auth('api')->user()

Resources