accredifysg/singpass-login
Laravel package for SingPass Login, MyInfo, and CorpPass using FAPI 2.0-style auth: OpenID discovery, Pushed Authorization Requests (PAR) with DPoP, PKCE, and private-key JWT client assertions. Includes shared services and thin provider controllers.
Adopt if:
Look Elsewhere if:
*"This Laravel package lets us integrate with Singapore’s government identity services (SingPass, MyInfo, CorpPass) in weeks instead of months. It handles the complex OAuth2/OIDC security protocols (like DPoP and PKCE) for us, reducing development risk and cost. For example:
ROI:
*"This package abstracts the FAPI 2.0/OIDC complexity (DPoP, PKCE, PAR, JWKS) into reusable Laravel services. Here’s how we’d use it:
Shared Infrastructure:
ndi.php once for JWKS, signing keys, and DPoP (shared across SingPass/MyInfo/CorpPass).FapiAuthenticationService and FapiCallbackService.Provider-Specific Flows:
/ndi/sp/login to trigger auth, then listen for SingPassSuccessfulLoginEvent to map users via NRIC.mobileno or dob via /ndi/mi/callback; data arrives in MyInfoDataRetrievedEvent.CorpPassSuccessfulLoginEvent and CorpPassDataRetrievedEvent.Customization:
SingPassLoginController for your own).MyInfoDataRetrievedListener for data validation).Security:
/ndi/jwks) is always available for provider validation.Trade-offs:
Next Steps:
accredifysg/singpass-login to composer.json.php artisan vendor:publish) and set SINGPASS_CLIENT_ID, MYINFO_CLIENT_ID, etc.SingPassSuccessfulLoginEvent to map users.Alternatives Considered:
Recommendation: Proceed with this package for MVP, then evaluate if we need to fork for custom features."*
How can I help you explore Laravel packages today?