ljsystem/bankid
A Laravel package for integrating Swedish BankID electronic identification and signing into your application. It provides a simple, configurable way to initiate authentication, verify users, and handle BankID flows within PHP projects.
Architecture fit. ljsystem/bankid is a thin Laravel-oriented wrapper around the Swedish BankID RP JSON API (auth, sign, collect, cancel, and the animated-QR/phone flows exposed by the v6 API). Architecturally it slots in as an authentication/signing adapter: the host application delegates the "identify or sign this user" intent to the package, which owns the mTLS HTTP conversation with BankID and returns a status object the app polls until complete/failed. That is a good fit for the typical Laravel use cases (login, step-up identity, contract/e-signature), but it is not a full identity product — it provides transport and endpoint ergonomics, not session orchestration, audit trails, or consent UX. Expect to build the state machine (start → poll → complete → bind to local session) yourself.
Integration feasibility. High for teams already on Laravel with a BankID RP agreement in place. The hard prerequisites are non-code: a BankID relying-party agreement, a production/test client certificate (mTLS, rotated periodically), and network egress to BankID's endpoints. Test-environment onboarding is the standard first milestone. The package's value is mostly convenience — config publishing, a facade, request/response shaping, and error-code mapping — so the integration effort is dominated by certificate and flow work, not by the library.
Technical risk. The dominant risk is maturity and bus factor: 20 stars and a single-maintainer signal mean limited community validation, uncertain release cadence, and no guarantee of prompt fixes for upstream BankID API changes (v5→v6 animated QR was a breaking ecosystem shift; further versioning is expected). Secondary risks: certificate and secret handling (how the package loads/validates P12/PEM), PHP/Laravel version constraints and PSR-4/autoload quality, test coverage (likely thin), and security posture — this code path touches identity, so any weakness is high-severity. License is MIT, which is favorable (forkable), and the surface area is small enough that a fork is a realistic mitigation.
Key questions.
auth, sign, collect, cancel, phone/auth, animated QR generation, and BankID error-code taxonomy (certificateErr, userCancel, outstandingTransaction, startFailed, etc.)?Stack fit. Assumes a Laravel app on a currently supported PHP/Laravel pair with Composer. If the app is on Symfony, plain PHP, or a non-Laravel framework, the wrapper's value drops sharply and a direct HTTP client against BankID may be cleaner. Confirm framework fit before committing.
Migration path. Do not let the package leak into domain code. Define a narrow internal interface (e.g., IdentityProvider::start()/poll()/cancel()) and implement it with this package. That gives you a swap point for a maintained alternative or an in-house client if the package stagnates, and it keeps the BankID-specific status/error vocabulary out of your auth controllers. Persist the BankID orderRef/autoStartToken and transaction state in shared storage so any node can service the polling request.
Compatibility. Verify: cert format and loading path, BankID test vs production base URLs, animated-QR rendering (the package may or may not generate the QR payload/PNG — plan for a front-end QR library if not), same-device vs other-device flow differences, and the BankID mobile app version assumptions in test. Also check whether the package's config expects env vars that conflict with your secrets management.
Sequencing.
orderRef, status transitions, and error codes (no PII beyond what's necessary).Maintenance. Budget for active ownership rather than passive dependency: pin the version, subscribe to repo releases and upstream BankID API notices, and maintain a fork-ready patch process. Given 20 stars, assume you may become the de facto maintainer of your copy. Track certificate rotation (BankID certs expire) as a calendar-driven operational task with alerting.
Support. Incidents split into two classes: your bugs vs BankID outages. BankID publishes status/incident channels; wire those into your on-call runbook. User-facing support needs a clear message taxonomy for common failures (user cancelled, expired QR, bank not reachable, cert error) — the package's error mapping is worth auditing so support staff see actionable reasons, not raw codes.
Scaling. The API calls are stateless HTTP, so horizontal scaling is fine, but polling is the load driver: each in-flight authentication produces repeated collect calls. Enforce a server-side polling interval (BankID expects roughly once per second) and a maximum duration, and consider pushing polling to the client with throttling or to a queue-backed worker to avoid hammering from many concurrent sessions. Ensure shared cache/session so collect can be served by any instance; otherwise sticky sessions become a hidden constraint. Egress to BankID must be allowlisted and provisioned for peak concurrency.
Failure modes.
orderRef not found, orphaned sessions; requires shared state store.Ramp-up. Expect a few days for a Laravel developer to become productive: BankID's flow model (start/collect/cancel, same-device vs QR), the test app and test certificates, and the package's conventions. Add domain ramp-up for whoever owns identity and compliance — BankID usage carries data-protection and audit expectations (what you store, how long, and what you log) that the package does not address. Given the small community, plan for the first engineer to read the package source rather than rely on documentation, and capture findings in an internal integration guide so the knowledge is not single-threaded.
How can I help you explore Laravel packages today?