-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SAML2 compatibility #101
Comments
Can you do some debugging using |
This is the only one I can find:
|
Yes,so the route seems to be defined. Please check carefully where the 404 comes from because this route will redirect you to the external provider. (btw the "admin" prefix comes from your Filament Panel ID if im correct; it can be changed with the |
@bert-w, thanks for your help. I changed the slug to "auth" to test it out, but I was still having the same issue. The route is set up correctly. The package recognises that the saml2 provider is registered, otherwise, it would throw an error indicating it's not configured. After some debugging, I found that the issue occurs here: https://github.com/DutchCodingCompany/filament-socialite/blob/main/src/Http/Controllers/SocialiteLoginController.php#L36-L42. I commented out To rule out any issues with the driver, I tried a few things and I worked out that it works if I add one of these two routes in my web routes file: Route::get('/auth/callback', function () {
$user = Socialite::driver('saml2')->user();
});
Route::post('/auth/callback', function () {
$user = Socialite::driver('saml2')->user();
}); Now, I'm not getting a 404 anymore, but I'm encountering an incompatible type hint error: DutchCodingCompany\FilamentSocialite\Http\Controllers\SocialiteLoginController::redirectToProvider(): Return value must be of type Illuminate\Http\RedirectResponse, Symfony\Component\HttpFoundation\RedirectResponse returned After removing the return type here https://github.com/DutchCodingCompany/filament-socialite/blob/main/src/Http/Controllers/SocialiteLoginController.php#L27 , I finally get redirected to the identity provider. But I still have two questions:
|
I guess for the return type as one extends the other and it seems to be working with the wider one, I could submit a PR for that if you like if it isn't breaking anything. |
Maybe the redirect URL is incorrect, can you verify it is the same as this:
Since you are getting a 404 the redirect URL might be incorrect. |
@bramr94 I see. I played around with the routes again. If I register something at Route::get('/auth/callback', function () {
$user = Socialite::driver('saml2')->user();
}); But if I change it to |
I can see it's hardcoded in this package so it can't be changed. I'll check if I find something in the saml2 driver package |
Got it now. I had to define it with the correct 'saml2' => [
'metadata' => '...',
'sp_acs' => '/oauth/callback/saml2',
], The return type is still an issue though. Do you think it should be changed here or on the SAML2 socialite provider? |
I can't see how I can change it in the SAML2 driver repo, but I also think it could be a breaking change. Someone else might be checking for the parent class. So I think it would be best to change it in this package. Are you ok with that? I prepared a pull request for that: #103 |
I tried to implement a simple integration of the SAML2 provider: https://socialiteproviders.com/Saml2/
I can see the button
but it takes me to
/admin/oauth/saml2
which results in a 404. I don't even understand where theadmin
part comes from as that isn't my panel url. Did I miss anything setup-wise? I installed this package and the socialite driver and set up the provider config. I then simply added this to the panel:and this to my EventServiceProvider
Are there any routes I need to set up? I was hoping this package handles that.
The text was updated successfully, but these errors were encountered: