- How do I install itk-dev/openid-connect in a Laravel application?
- Install the package with Composer by running composer require itk-dev/openid-connect. Then follow the package README to publish any configuration and add your OpenID Connect provider settings. Check whether the package requires migrations or middleware registration for your Laravel version. After configuration, test the login redirect and callback routes in a non-production environment.
- How does this package use the OpenID Connect Discovery document?
- The package configures OpenID Connect by reading the provider's discovery document, which contains endpoints and metadata such as authorization, token, userinfo, and logout URLs. You typically provide the issuer or discovery URL in configuration instead of hardcoding every endpoint. This keeps configuration aligned with the identity provider. Review the README for the exact configuration keys and any caching options.
- Does itk-dev/openid-connect support the OIDC authorization code flow?
- Yes, the package is described as supporting the authorization code flow for OpenID Connect login. Your Laravel app redirects the user to the identity provider, handles the callback, and completes the login flow. You then use the package middleware or helpers to require authentication on protected routes. Confirm any PKCE or client secret requirements in the README and provider settings.
- Can I configure multiple OpenID Connect providers with this Laravel package?
- The package advertises configurable providers, so it is intended for apps that need to define OpenID Connect provider settings rather than a single hardcoded integration. You can usually define provider-specific configuration and select the appropriate provider for your login routes or guards. Check the README for the supported multi-provider configuration shape. Test each provider's discovery, callback, and logout behavior separately.
- How do I retrieve userinfo and map OIDC claims to a Laravel user?
- The package includes userinfo retrieval as part of the OpenID Connect flow, so after a successful login you can access claims returned by the provider. Use those claims to find or create a local Laravel user and store the authentication state according to your app's design. The exact mapping depends on your provider's claims and the package configuration. See the README for hooks or customization points before writing custom logic.
- Does itk-dev/openid-connect support logout?
- Yes, logout support is part of the package's described feature set. You can clear the local Laravel session and, where the provider supports it, redirect to the provider's end-session endpoint. The discovery document may supply the logout endpoint, so check how the package exposes that configuration. Test both local and provider-side logout behavior with your identity provider.
- How do I protect Laravel routes with the package middleware?
- The package provides middleware and helpers for integrating external identity providers, so you apply its authentication middleware to routes or route groups that require OIDC login. Unauthenticated users are redirected into the OpenID Connect flow, and successful logins return to your callback route. Register or alias the middleware as instructed in the README. Then verify that public routes remain accessible and protected routes enforce authentication.
- Which Laravel and PHP versions does itk-dev/openid-connect support?
- The exact Laravel and PHP version constraints are defined in the package's composer.json and should be checked before installation. The package is aimed at Laravel applications, but supported versions can change between releases. Review the README, Packagist metadata, and release notes for the current compatibility matrix. If you are on an older Laravel version, confirm support before adding it to production.
- How can I test OpenID Connect login locally with this package?
- Point the package configuration at a local or staging OpenID Connect provider, such as a test identity provider, and verify the discovery, callback, userinfo, and logout flows. For automated Laravel tests, mock the discovery and userinfo HTTP responses or use a test provider rather than calling a real external service. Keep test client credentials out of source control. Run the full login flow in a browser at least once before deploying.
- What should I check before using itk-dev/openid-connect in production?
- Review the repository's release history, open issues, and Composer constraints to confirm the package is actively maintained for your Laravel version. Make sure the discovery document is fetched over HTTPS and that client secrets, session settings, and callback URLs are configured securely. Test login, userinfo, error handling, and logout against the real identity provider in staging. Also decide how you will handle provider metadata changes and package upgrades.