Setup BankID 🔧⚓
Prepare test environment⚓
Test certificates 🧾⚓
- Goto https://www.bankid.com/en/utvecklare/test
- Click "Download ⬇"
- You'll get
.p12
file -
To parse
key.pem
from it, use this command:Where
-in
must be a filename and path to.p12
file, password-passin 'pass:<PASSWORD>'
Example
This command will produceopenssl pkcs12 -in FPTestcert4_20220818.p12 -out key.pem -nocerts -nodes -legacy -passin 'pass:qwerty123'
key.pem
fileTip
Usually test password for BankID
.p12
file is:qwerty123
-
To parse
cert.pem
from it, use this command: -
Copy inner certificate and key data to your environment variables or
.env
file, for example:
Example of .env
file
BANK_ID_HOST=https://appapi2.test.bankid.com/rp/v5.1
BANK_ID_CERTIFICATE='-----BEGIN CERTIFICATE-----
MIIEyjCCArKgAwIBAgIIMLbIMaRHjMMwDQYJKoZIhvcNAQELBQAwcTELMAkGA1UE
BhMCU0UxHTAbBgNVBAoMFFRlc3RiYW5rIEEgQUIgKHB1YmwpMRUwEwYDVQQFEwwx
MTExMTExMTExMTExLDAqBgNVBAMMI1Rlc3RiYW5rIEEgUlAgQ0EgdjEgZm9yIEJh
bmtJRCBUZXN0MB4XDTIyMDgxNzIyMDAwMFoXDTI0MDgxODIxNTk1OVowcjELMAkG
A1UEBhMCU0UxHTAbBgNVBAoMFFRlc3RiYW5rIEEgQUIgKHB1YmwpMRMwEQYDVQQF
Ewo1NTY2MzA0OTI4MRcwFQYDVQQpDA5UZXN0IGF2IEJhbmtJRDEWMBQGA1UEAwwN
RlAgVGVzdGNlcnQgNDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL4L
8ERHNSi7Jph9gj4ah7Ieok5lZHZbNyW1AiJJ1OfeD1lbAzxSidtTu6NfC83zxCjL
q091lHY5G7dpNDt1rN5Y+jQvrtcLc8nUpgqLfEUnbGKzZaHlO97jh6pqO8nj/mal
TrWI70Fr6SO3SxbsgxuwJXlRUAQxI0mPvD1gOd+uymA+EqdYS39ijC2eICHSf7bU
wvmscy8TAyEcT4GYmcjai1vbIj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ecT3Vwepgp8CgYAsocIyzRVTnklU4RBHFDmBzwrDUklZUKT2oixmmL3Rr/wM7VyX
w0gDRRF9h4Ylz0A2/9+t1Q5U04tcidJDJePo6fYxFpDL05MNkLSETIdnqun1g8PK
FJi3BLsPq2UuBYHfb9Zeem0gAZPc88EZmdxAhdZr0qkI/7lgcrqQEzkIeQKBgGri
kVfOqSaPEStdL+VR5JAlGPmWtgIVY/DlJtcH5Jgg0XaHFZSg5ePomFKNs9dpjigU
jgYU+avhKr9w/NyBR8yoIRGCeh5qeMVjVhw1kJ9nY9E4sx6xApkudw2Ri2opc9ja
h8pTF/9ndlPT6WkdaD9yHWVJKEYStFnVG326gtIbAoGAetLNOSZBSW03SJlI7dhY
4hycNElfSd0t89Bf4YcYbWrpySeKCG0oTO7Y56ZS9RmgNEyz4HNXZcQ56inMNY6Z
M+o1wGEKJKLBtCJHZp7Sh8zy/RMI3naF4vc4r4BpK9k5ZAEL8gHVm9M5C2ZG8whc
r+Uu/g0P3m8w7INgsjxQy/U=
-----END PRIVATE KEY-----'
Test account 💼⚓
Here is a guide: Get BankID for test
Issue personal code⚓
Tip
Use this method when you set up your environment for the first time. Otherwise, use this methods mobile or desktop.
- Goto https://demo.bankid.com/ordercode
-
Fill form with your data (organization, email, project, fist name, last name)
Organization email
Email should be a corporate, emails with
@gmail.com
domain wouldn't work❗ -
Goto your corporate email, you'll obtain a test 30-days trial code.
Login with personal code⚓
- Use this code to log in https://demo.bankid.com/logincode
- It's all, now you'll be able to set up Mobile / Desktop BankID environments.
Login with mobile app⚓
This is method to log in to test account using mobile app and QR code.
Tip
Use this method when you already set up your test account via personal code Issue personal code.
- Go to https://demo.bankid.com/logintest
-
Open your BankID test app and scan QR code.
Warning
Mobile app should be configured, read here Mobile test environments.
Login with desktop app⚓
This is method to log in to test account using desktop app.
Tip
Use this method when you already set up your test account via personal code Issue personal code.
- Go to https://demo.bankid.com/logintest
-
Click "Alternative: Start BankID Security Application on this device.".
Warning
Mobile app should be configured, read here Mobile test environments.
Mobile test environments⚓
Test Android app 📱⚓
Here is a guide: BankID test configuration
-
Install BankID app from your app store.
-
Enable "airplane mode".
-
Open BankID app (you'll be notified that is no connection, click "OK").
3.1 Click "⚙ Settings".
3.2 Click "About BankID".
3.3 Make a "long press" on the heading
Error information
in the input dialog enterkundtest
and save.Note
If everything is "OK", it appears
CUST
after the Version. -
Exit app, and also close it from background.
- Disable "airplane mode".
- Done.
Test iOS app 📱⚓
-
Uninstall any existing version of BankID Security App and then reinstall it from App Store.
-
In Settings → BankID → Developer → Server, enter
cavainternal.test.bankid.com
. -
Done, BankID Security App will connect to the test server.
Note
Please note that the app must be uninstalled/reinstalled to be restored for the production environment.
TODO Screenshots
If you have an iPhone you can help to document it with screenshots (Contributors welcome).
Desktop test environments⚓
Test Windows app 🖥⚓
- Download windows BankID desktop application (extra link)
- Install it.
- Run & close application.
-
Go to this path: C:\Users\USER_NAME\AppData\Roaming\BankID\Config
where USER_NAME - your Window's user.
-
Create file with name
CavaServerSelector.txt
- Write
kundtest
inside file and save it. -
Open application, navigate to: "File" → "Preferences" → "Info for support" → "Check connections" → click "Check".
You should get:
- BankID server: OK
- Update server: OK
-
Done.
Test MacOS app 💻⚓
TODO
If you have a Macbook, you can help to document it with screenshots (Contributors welcome).
Generate personal number (customizable)⚓
- Goto Personal number generator
- Select "Output format" as "YYYYMMDDNNNN".
- Select your gender.
- Fill out "Date of birth".
Generate random personal number with (fejk.se)⚓
- Generate personal number at: https://fejk.se/
- Get date of birth (without dashes).
- Get latest 4 digits of personnummer.
- Concatenate it without dashes.
Example
1) Date of birth 1996-10-21
→ 19961021
(remove dashes)
2) End of personal number -1238
→ 1238
(removed dash)
3) Result 19961021
+ 1238
→ 199610211238
(must be 12 digits length)
Issue BankID for test⚓
-
Login to Demo Bank.
-
Click selected button under "Issue BankID for Test".
Tip
- "Mobile BankID" - for mobile 📱;
- "BankID on file" - for desktop 🖥;
-
Fill data into fields (first name, last name, personal number).
Tip
You can use random first name and last name.
-
Click "Issue" and proceed with connection section, depends on your choice (mobile or desktop).
Connect with Android 📱⚓
Before start: requirements
-
Open BankID app.
-
Click "New BankID".
-
It will open scanner, scan QR code inside modal window.
Success screen at mobile:
Success screen at modal:
-
You can enable fingerprint to easy approve BankID confirmation.
-
You can check new test BankID connection inside your "Settings" under the BankID tab.
Note
P.S. Also your main screen now will have "QR code" button instead of "New BankID"
Connect with iOS 📱⚓
Warning
If you have an iPhone you can help to document it with screenshots (Contributors welcome).
Connect with Windows 🖥⚓
Before start: requirements
-
Click "Open BankID issuing".
-
It will open modal window with QR code.
Click "I have the most recent BankID application, proceed without installation >"
-
You will be prompted to set password. It should be secure enough.
-
Inside BankID Secure Application you'll get new record about BankID connection.
-
Done. Now you can test login with BankID at Windows Desktop.
Connect with MacOS 💻⚓
TODO
If you have a Macbook, you can help to document it with screenshots (Contributors welcome).