Api "401 - Unauthenticated" error after update laravel version - php

Laravel launchs a security release. I'm using Laravel 6.18.12 and trying to update to 6.18.29, so when I updated my composer.json file with "laravel/framework": "^6.18.29" I take this error:
Reading about it in stackoverflow I see that people that installed the doctrine/inflector at 1.4 fixed their problems. So I did it: composer install doctrine/inflector:1.4 and try update again the laravel with composer update laravel/framework but a new error happened:
Them I installed also the symfony/polyfill-php7.3 (I'm using PHP 7.3). Done that I could update the Laravel version, but I'm always getting this error 401 once I try to get my api data:
This happens to all my api requests. Looks like something about the auth:api middleware, but I'm not sure why. My user is logged in the web, I can use auth() stuff, but the api looks like the user isn't authenticated. Everything was working as fine before this update.
Ps: I'm not using passport, but I'm using spark alongside my project.

As I thought, this Laravel patch has to been solved also in the Spark, so now I'm updating to the newest version. For further information: Taylor answer

Related

Can't install Laravel Socialite via composer

I'm trying to require Laravel Socialite following the composer command in the DOCs but it's showing me the below error. Anyone knows what to do?
I'm using Laravel 9 and I don't think it's related to anything in my project so no need for code snippets.
hitting composer require laravel/socialite doesn't seem to work.
It was a network issue. I restarted my internet and it worked.

Laravel passport 7.5.1 - Replicating claims

We are having a new error related with laravel/passport: 7.5.1. Today, this library has been working as the last week. But this stops showing this message via Postman:
Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.
Do someone knows something about this issue?
We don't know how to continue with this...
We're using Laravel 5.7 (we know that...)
We "solved" this temporally downgrading the library lcobucci/jwt from 3.4.0 to 3.3.3.
help me in laravel 5.8
set in composer.json
"laravel/passport": "^7.5",
"lcobucci/jwt": "3.3.2",
and update vendor
composer update
For me downgrading, lcobucci/jwt worked for me. I was currently using 3.4.* but downgraded it to a constant 3.3.3
to downgrade I run the command
composer require lcobucci/jwt 3.3.3
And that was it. But my only concern is I am not certain if this is a temporary or a permanent solution to this issue. But at least it will reboot things up if your system failed cause of that error

Why "Class 'GuzzleHttp\Client' not found" even after Installing it in Laravel?

I've been reading answers from all the questions related to GuzzleHttp\Client but situation is getting worst. I am trying to send E-mail Updates to all of my Application users using Laravel Queues. I don't know what's wrong but Jobs are failing.
I am properly caching the Exceptions and reporting them to laravel.log file. Here is what I am getting when I try to execute queue worker.
[2018-03-23 11:43:06] production.ERROR: Class 'GuzzleHttp\Client' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'GuzzleHttp\\Client' not found at /home/polymath/saio/public_html/vendor/laravel/framework/src/Illuminate/Mail/TransportManager.php:181)
I've already installed GuzzleHttp\Client using composer require guzzlehttp/guzzle. It is successfully installed but still, I am getting the same error.
Even I tried to delete the current application files and clone my whole repository again. Still Facing the same issue. I even tried to clear caches using php artisan cache:clear , php artisan cache:config and php artisan clear-compiled(This made my whole application crash) , php artisan dump-autoload.
I can't find what's wrong but that's all logs say.
It seems you may need an older version of Guzzle to work with Laravel, try using Guzzle 3.x by updating your composer.json like such
"guzzlehttp/guzzle": "~3"
If you wish you can also try to use ~4 and see if Guzzle 4.x will work for you, remember to run composer update and composer dump-autoload after updating your composer.json file.
Update: This info is based on research since Laravel 4 and may be deprecated for Laravel 5.x
use GuzzleHttp\Client;
in your method Add
$client = new Client();

Target [League\OAuth2\Server\Repositories\ClientRepositoryInterface] is not instantiable while building [League\OAuth2\Server\AuthorizationServer]

I've recently set up a new Laravel 5.5 project on Ubuntu 16.04 with an NGINX server. I've followed all the correct steps and double checked everything more than once. I've installed Laravel/Passport and double checked those set up instructions as well.
I'm building an API that requires a login for most endpoints, which is done via password_grant with laravel/passport but can also consumes a Facebook auth token - instead of writing my own Facebook Auth Token verify, I've chosen to use a larval plugin. composer require danjdewhurst/laravel-passport-facebook-login However, this plugin doesn't seem to install easily for me.
I am receiving an error on any composer install or update command I issue:
Target [League\OAuth2\Server\Repositories\ClientRepositoryInterface] is not instantiable while building [League\OAuth2\Server\AuthorizationServer].
I have played around with the config/app.php file as well as the uses for all of the files and providers that were installed with the plugin. I have gone through every post here to try and fix the issue as well.
If anyone has any insight or a fix for this issue I'd appreciate it. Any help would help.
Thank you.
I found this to be an issue with the order of Laravel's auto discovery of packages. Obviously the Facebook Grant package needs to load after laravel/passport but this was not happening.
My solution was to add the following to my composer.json:
"extra": {
"laravel": {
"dont-discover": [
"laravel/passport",
"danjdewhurst/laravel-passport-facebook-login"
]
}
}
and then the following to my config/app.php in the providers array:
\Laravel\Passport\PassportServiceProvider::class,
\Danjdewhurst\PassportFacebookLogin\FacebookLoginGrantProvider::class,
After adding Laravel\PassportServiceProvider::class to config/app.php providers. I just deleted the .php from bootstrap/cache/ and it works.
I was trying to composer update and encounter the same problem.
Then I notice the dependencies in https://github.com/danjdewhurst/Laravel-Passport-Facebook-Login stated
"laravel/passport": "^4.0",
I solved my problem after updating my passport

how to use wepay PHP sdk in laravel 5?

I want to use wepay PHP sdk in laravel 5 using composer but I didn't found any laravel package for it.
Can you please tell me me how can I do this?
The package is available via packagist.org - unfortunately only as a dev-master branch and with suboptimal autoloading configured (I'm trying to fix that, sent both a patch and opened an issue suggesting they tag their version).
Adding that package is basic Composer action. The classes should be automatically available within Laravel wherever you think you want to use it.

Categories