Skip to content
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

SocialiteProviders\Saml2\Provider::getFirstAssertion(): Return value must be of type LightSaml\Model\Assertion\Assertion #1248

Open
Koni-DFX opened this issue Aug 21, 2024 · 0 comments

Comments

@Koni-DFX
Copy link

Koni-DFX commented Aug 21, 2024

Hi,

we are encountering an error when attempting to use SAML2 authentication with LibreNMS.

The Error Message is:

SocialiteProviders\Saml2\Provider::getFirstAssertion(): Return value must be of type LightSaml\Model\Assertion\Assertion, null returned {"exception":"[object] (TypeError(code: 0): SocialiteProviders\\Saml2\\Provider::getFirstAssertion(): Return value must be of type LightSaml\\Model\\Assertion\\Assertion, null returned at /librenms/vendor/socialiteproviders/saml2/Provider.php:482)"}

System Information:

LibreNMS Version: librenms-24.7.0v0/librenms-24.8.0v0
Operating System: OpenBSD 7.5
PHP Version: php-8.2.22
socialiteproviders/saml2 4.7.2
litesaml/lightsaml v4.2.0

SAML2 Setup Details:

We have configured the SAML2 authentication by following these steps:

LibreNMS Configuration: We executed the following commands to configure SAML2:
lnms config:set auth.socialite.redirect false
lnms config:set auth.socialite.register true
lnms config:set auth.socialite.configs.saml2.listener "\SocialiteProviders\Saml2\Saml2ExtendSocialite"
lnms config:set auth.socialite.configs.saml2.metadata "$(cat metadata-file.xml)"
lnms config:set auth.socialite.configs.saml2.sp_default_binding_method urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST lnms config:clear`

services.php Configuration: We added the following SAML2 configuration to our services.php file:

   'saml2' => [     'sp_certificate' => file_get_contents('/etc/saml2/certs/certs/our-cert.crt'),       
      'sp_private_key' => file_get_contents('/etc/saml2/certs/private/our-key.pem'),       
      'sp_sign_assertions' => true, // or false to disable assertion signing     'sp_acs' =>  
      'auth/saml2/callback',     'listener' => '\SocialiteProviders\Saml2\Saml2ExtendSocialite',   
    l],

app.php Configuration: Additionally, we modified app.php as follows:

       'providers' => ServiceProvider::defaultProviders()->merge([     
       Laravel\Socialite\SocialiteServiceProvider::class,       
       \SocialiteProviders\Manager\ServiceProvider::class, ... ])`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant