Comments (2)
Ok so for the next retarded developer who finds this issue, the problem was that I didn't realize that I had to pass the configuration before calling ->user()
as well.
So do something like this;
$user = Socialite::driver('azure')->setConfig($config)->user();
from providers.
@robinbertram Must have overlooked this issue. The cleanest solution for that kinda issue is to handle it like this to make sure you always call the driver with the full configuration.
<?php
namespace App\Http\Controllers;
class SocialiteController extends Controller
{
public function redirectToProvider(string $driver): RedirectResponse
{
return $this->getSocialiteDriver($driver)->redirect();
}
public function handleProviderCallback(string $driver): RedirectResponse
{
$user = $this->getSocialiteDriver($driver)->user();
}
public function getSocialiteDriver(string $driver, array $config = [])
{
$config = new \SocialiteProviders\Manager\Config($config->client_id, $config->client_secret, $config->redirect_url, [
'tenant' => $config->tenant_id
]);
return Socialite::with($driver)->setConfig($config)
}
}
from providers.
Related Issues (20)
- Tiktok Update HOT 2
- StreamElementsProvider needs a new version release on composer HOT 4
- Linkedin: Add Linkedin OpenId Socialite Provider. HOT 1
- Microsoft provider generates error for only some users - error AADSTS900144 HOT 10
- DELETE.
- Microsoft provider does not return refresh_token HOT 3
- Socialite 5.11 introduced conflicting refreshToken method HOT 7
- SocialiteProviders/Authentik needs a new release HOT 1
- Merge Microsoft and Azure provider HOT 4
- Stateless discord oauth gives 401 unauthorized error when trying to collect user HOT 2
- OIDC token request results in failure multiple_client_credentials HOT 1
- Azure B2C provider failing with not supported? HOT 6
- Upgrade monorepo-builder to v11
- SAML2 provider - can't configure repeated_id_ttl and clock_skew HOT 1
- PKCE crashes when using stateless
- Azure B2C provider puts scope incorrectly HOT 1
- AzureADB2C has error in emails mapping HOT 3
- SAML2 Driver HOT 2
- Azure: Add support for optional post_logout_redirect_uri HOT 2
- Docs on how to use `SocialiteWasCalled[]` in Laravel 11 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from providers.