Skip to content

Environments#

The BankID module supports three operating environments: Mock, Test, and Production. Configure the active environment under Configuration > System > BankID Settings (/admin/config/system/bankid).


1. Mock Environment#

The Mock environment is designed for local development, automated testing, and CI pipelines without requiring SSL certificates or internet connectivity to BankID servers.

  • No Certificates Needed: Bypasses mTLS validation and Key repository requirements.
  • Simulated Order States: Generates local mock tokens and simulates the BankID QR code flow.
  • Interactive Test Form: When the BankID dialog opens, a mock control form is presented alongside the QR code:
  • Enter any Swedish Personal Identity Number (SSN), Given Name, and Surname to test successful completion.
  • Test edge cases and error states by triggering simulated outcomes such as cancel, expired, or certificate_error.

2. Test Environment#

The Test environment connects to BankID's official pre-production API (https://appapi2.test.bankid.com/rp/v6.0/).

  1. Follow the official guide on Test BankID and create a BankID for test.
  2. Generate a test personal number from the Swedish Tax Agency (Skatteverket).
  3. The test environment comes pre-configured with default test keys in the module's assets/ directory (FPTestcert5_20240610.p12 and test CA certificate), which are imported automatically upon module installation.

3. Production Environment#

The Production environment connects to the live BankID service (https://appapi2.bankid.com/rp/v6.0/).

  1. Order production Relying Party (RP) certificates from your bank according to the BankID Technical Integration Guide.
  2. Store the certificates in a secure directory outside of the web root on your server.
  3. Use the Key module (/admin/config/system/keys/add) to register keys using the FileKeyProvider:
  4. RP Certificate: Path to your .p12 or .pem certificate.
  5. RP Passphrase: Passphrase for the certificate key.
  6. Server CA Certificate: The issuer certificate (test_cacert.cer or BankID production root CA).
  7. In BankID Settings (/admin/config/system/bankid), select the corresponding keys under the Production fieldset.