Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Bank Id Laravel Package

dimafe6/bank-id

Laravel package for working with BankID: send authentication/sign requests, collect results, and handle statuses. Includes configurable client setup, helpers, and examples for integrating BankID flows into your PHP app.

View on GitHub
Deep Wiki
Context7

BankID

Frequently asked questions about Bank Id
Does this package support both BankID authentication and e-signatures in Laravel?
Yes, the package supports both authentication and signing flows. For signing, use `getSignResponse()` with user data, while authentication uses `getAuthResponse()`. Both flows require collecting the `orderRef` until completion. The README shows examples for both use cases.
What Laravel versions and PHP requirements does this package support?
The package requires PHP 7.4+ and is designed for Laravel applications. While the package itself doesn’t explicitly state Laravel version compatibility, it integrates with Laravel’s service container and middleware, so it should work with Laravel 8.x and 9.x. Test thoroughly with your Laravel version.
How do I configure SSL verification for BankID’s production environment?
For production, you must provide SSL verification paths in the `BankIDService` constructor. Use the `verify`, `cert`, `ssl_key`, and `ca` options to point to your BankID certificate files. The README provides an example with `PATH_TO_TEST_CERT.ca`, `PATH_TO_TEST_CERT.crt`, and `PATH_TO_TEST_CERT.key`.
Can I use this package with BankID’s sandbox (test) environment?
Yes, the package supports BankID’s sandbox environment. Use the test endpoint `https://appapi2.test.bankid.com/rp/v5.1/` in the `BankIDService` constructor. Disable SSL verification for testing by setting `'verify' => false` (not recommended for production).
How do I handle BankID session timeouts (e.g., 5-minute expiry) in Laravel?
BankID sessions expire after ~5 minutes. The package requires you to repeatedly call `collectResponse($orderRef)` until the status is `STATUS_COMPLETED`. Implement a loop or use Laravel’s queue system to poll for completion. The README includes a code snippet demonstrating this polling mechanism.
Are there any known conflicts with Laravel’s default dependencies (e.g., Guzzle, Monolog)?
The package may depend on `guzzlehttp/guzzle` and `monolog/monolog`. Check your `composer.json` for version conflicts, especially with Guzzle, as Laravel often uses it for HTTP requests. If conflicts arise, explicitly require compatible versions in your project’s `composer.json`.
Does this package provide Laravel migrations for storing BankID user data?
No, the package does not include migrations. You’ll need to create a table (e.g., `bank_id_credentials`) to store `orderRef`, personal numbers, or other BankID-related data. Consider adding fields for GDPR compliance, such as data retention policies or audit logs.
How can I test this package without real BankID credentials?
Use BankID’s sandbox environment with test personal numbers (e.g., `191212121212`). Disable SSL verification for testing (`'verify' => false`) and mock SOAP responses in unit tests. For integration tests, use the sandbox endpoint and validate responses against expected BankID status codes.
What are the alternatives to this package for Laravel BankID integration?
The official BankID SDK (`bankid/bankid-sdk-php`) is another option, though it may require more manual Laravel integration. This package abstracts BankID’s SOAP/WS-Trust complexity, making it easier to implement in Laravel. Compare features like API version support (V4 vs. V5) and maintenance status before choosing.
How do I integrate this package with Laravel’s authentication system (e.g., Guard, Authenticatable)?
Bind the `BankIDService` to Laravel’s service container in a service provider. Use middleware to redirect users to BankID for authentication, then validate the `orderRef` response. Store the BankID personal number or credentials in the `users` table or a custom table, and link it to Laravel’s `Authenticatable` model.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity