- How do I install javer/lightsaml in a Laravel project?
- Install it with Composer by running composer require javer/lightsaml in your Laravel project. LightSAML is framework-agnostic, so there is no Laravel service provider to register; you use its classes directly from controllers, services, or custom packages. Make sure your PHP environment has the required XML and OpenSSL extensions available for signing and encryption.
- Does javer/lightsaml support Laravel 10 and Laravel 11?
- javer/lightsaml is not tied to a specific Laravel version because it is a framework-agnostic PHP library. It can be used in Laravel 10, Laravel 11, or other Laravel versions as long as your PHP version and Composer dependencies are compatible. Check the package's Composer requirements and test your SAML flows after upgrading Laravel.
- How do I create a SAML AuthnRequest with javer/lightsaml in Laravel?
- Use LightSAML's AuthnRequest and binding classes to build the request, set the destination, issuer, assertion consumer service URL, and protocol binding, then sign it if your IdP requires signed requests. For HTTP-Redirect binding, encode and redirect the request to the IdP SSO URL; for HTTP-POST, render an auto-submitting form. Keep the request ID in the session so you can match it to the SAML response later.
- Can javer/lightsaml validate SAML responses and assertions?
- Yes. LightSAML provides response and assertion processing plus XML security for signature verification and decryption. You should validate the signature, issuer, audience, destination, timestamps, and subject confirmation, and decrypt encrypted assertions when configured. Use the higher-level profiles where possible, and add application checks for replay protection and session binding.
- How do I generate SP metadata and parse IdP metadata with javer/lightsaml?
- LightSAML includes metadata generation and parsing for service providers and identity providers. Build an SP metadata document with your entity ID, assertion consumer service endpoints, single logout endpoints, and signing certificate, then publish it to the IdP. Parse the IdP metadata to extract its entity ID, SSO and SLO endpoints, and signing certificates for your configuration.
- Does javer/lightsaml support SAML single logout?
- Yes, the library covers SAML 2.0 single logout profiles along with single sign-on and metadata exchange. You handle logout requests and responses through the appropriate bindings, validate signatures, and clear your Laravel session after successful logout processing. Test both SP-initiated and IdP-initiated logout against your identity provider.
- How do I sign and encrypt SAML messages with javer/lightsaml?
- LightSAML's XML security layer supports signing, signature verification, encryption, and decryption. Configure your private key and certificate for signing or decryption, and load the IdP or SP certificate for verification or encryption. Apply signing and encryption at the message or assertion level according to your IdP's metadata and requirements.
- Is there a Laravel service provider for javer/lightsaml?
- No, javer/lightsaml does not ship with a Laravel service provider or facade because it is designed as a framework-agnostic PHP library. You integrate it by resolving its classes in Laravel controllers, services, middleware, or a small custom wrapper package. If you need drop-in Laravel configuration, look for Laravel-specific SAML packages or build a thin adapter around LightSAML.
- How should I test SAML SSO with javer/lightsaml?
- Write PHPUnit tests around XML generation, metadata parsing, signature verification, and response validation using known SAML fixtures. For integration tests, simulate the IdP with signed responses and exercise your Laravel routes for login, assertion consumption, and logout. The library does not provide Laravel-specific test helpers, so keep test configuration isolated and avoid using production certificates.
- What are alternatives to javer/lightsaml for Laravel SAML SSO?
- Alternatives include Laravel-specific SAML packages that wrap SAML toolkits and hosted identity provider solutions that handle SSO for you. Choose javer/lightsaml when you need low-level XML control, custom profiles, and framework-agnostic SAML 2.0 support. If you prefer minimal configuration inside Laravel, evaluate a dedicated Laravel SAML wrapper before committing.