First read: Some technical facts about the Swedish BankID
Testing of the Service
- There is no checking (on any service level) that the initiation is setup with a real personal number – only the format needs to be correct. So any merchant can initiate a new auth/sign session for any personal number – even a non-existing personal numbers or nowhere registered bankID app account can be used. This fact can simplify testing and is true for both the test and the real BankID service environment.
- For someone to actually respond to a outstanding auth/sign request in his/her BankID app (within the allotted time frame of three minutes) you need to have set up either a self-created BankID test user+test app for the test service, or contact someone in real life with a real Swedish user with an activated BankID app.
- You can stress test (with many concurrent calls) the service, at least the initiation and polling parts of the service, without having set up BankID test test users or apps for the test. This is good to know since setup of test users can be time consuming and troublesome.
- You only need to create one or a few BankID test account (test user+test app) to test the full workflow including the BankID app signing/authentication step by the end-user.
- Here is a link to a site where you can easily randomly create a fake Swedish personal number with a valid format.
- Link to the official Swedish BankID integration portal
- Link to BankID´s offical PDF guide for installing a BankID app for test
Install BankID app for test on Android/IPhone mobile phone.
Testing with the BankID app on mobile device BankID app is recommended since that is how most people use the product in real life. Today practically all BankID authorizations are performed via the mobile BankID app, the rest ca 2% from a BankID app on a PC or Mac. note however that it is very common for the authorization to be initiated on a PC/Mac, but the BankID app on a mobile is used in the process.
For Android: The link to the Android APK-file can be found here. This approach can be more convenient for testers that want to keep the BankID production app in use. The setup needs a few extra steps to allow non-trusted applications on the mobile, see for example the android instructions on the BankID help instructions below.
For IPhone: Uninstall any existing version of BankID Security App. Install BankID Security App from App Store. In the IPhone Settings locate the BankID app select Developer and then enter cavainternal.test.bankid.com in the server window. BankID Security App will now connect to the test server. Please note that the app must be uninstalled to undo the change.
Install BankID app on on PC/Mac, configured for test aka “certificate on file”
See Step-by-step guide below. The process should be run from demo.bankid.com and takes a couple of minutes. With a PC/Mac install there is no need to interrupt the production BankID mobile app. For a more detailed description see this. [If the testversion installation process runs into problems, you can adjust the production version of a BankID app, installed from https://install.bankid.com and configure it for test by adding the extra textfile CavaServerSelector.txt which should be saved containing the text kundtest into the folder (for Windows) %appdata%\bankid\Config (note that this instruction can also be found here https://demo.bankid.com/Konfigurera.aspx)]
Step by step – Swedish BankID for Test (on file)
Note: if the below install ends with failure try to kill the BankID process with Task Manager and start over. Browse to demo.bankid.com and click Generate new code.
Fill out all fields, but only the email address needs to be correct. Press Order code to receive an email.
Confirmation message that asks you to open your email.
Go back to the start page demo.bankid.com, now login with the received code.
Now chose Issue BankID for test.
In this example we chose to Issue BankID on file. (for a personal computer.) The personal number and name here can be chosen freely, but the personal number needs to be correctly formatted, for example 198710243505 for a Swedish woman born on October 24th 1987. Recommendation: For matching BankID test users with the persons available in the LookupPerson and SearchPerson test data, use one of the personal numbers found on this page. Press Issue.
A popup will appear, press the only available button Open BankID Issuing.
A new browser window will be started where you can download the BankID application and activate your new user. Press Download the BankID application if this is the first time. In case of problems it is often better to click “I have the most recent BankID application, proceed without installation.”
The application will be downloaded and you will need to Run the installer.
After the installation is complete you should activate your BankID with the new user and chose a password.
Press Start to start the BankID application.
In the BankID application you will immediately be asked to set a password for the new user, 6 digits is enough.
The new BankID user is setup and is ready to be used.
How to install a Swedish BankID for Test on File (long text description)
You need to install the current version of the BankID-app and also install and activate the account for BankID for Test on file. Follow these steps:
- Browse to https://demo.bankid.com/
- To get a BankID for Test (and you don’t already have one installed for Production), you first need to generate and login with a code. Click on Generate code at the bottom left.
- You will be redirected to https://demo.bankid.com/CreateCode.aspx . Here you need to enter some personal information such as your name, email and organization.
- Press Order Code. You will now receive a personal code in an email.
- Return to https://demo.bankid.com/ and paste the code into the text box at the bottom left and chose Log in (with personal code)
- You will be redirected to this page: https://demo.bankid.com/MainMenu.aspx Press the button Issue (BankID for test)
- You will be redirected to this page: https://demo.bankid.com/Hamta.aspx. Here you should use the right side of the form ”Issue BankID on file” and choose a fake or existing Swedish personal number, and any first and last name for your test person. I chose ”191212121212” because I know that number is a technically valid personal number, and the name ”Chris” ”Cat”.
- You will see a popup overlay window in the browser with the title ”Open BankID issuing”. Push button ”Open BankID issuing”.
- A 3-step guide will open up in a new browser window. This will guide you through the process of installing BankID-app and create and activate a test certificate on file. You can change the language in the guide to English if you want to.
- Press the button ”DOWNLOAD THE BANKID-APPLICATION” or click on the link ”I already have the latest version of the BankID-app, continue without installation >” (this document has not yet checked the exact English wordings…)
- On the third and last step of the guide you will activate you BankID for test (your test certificate) by choosing a personal, at least 6 letter, password. Press ”CONTINUE” and in the next popup window press ”Start the application”.
- Then the BankID-app will pop up and you will get to create the BankID password that you will use every time you are asked to authenticate or sign through the Swedish BankID process. I for example chose the password ”Chriscat”
- When the guide is complete you can test your ”BankID on file” through the page https://demo.bankid.com/ Click on ”Log in” (with test BankID) at the top left.
- You will be redirected to https://demo.bankid.com/Logon.aspx?environment=Kundtest where you can select on the left side Log in (BankID on same device).
- When you have pressed ”Log in” the BankID-app will start in a small popup window, and you can select your test user in the drop down (you can have many) and enter the password for the test user. Then you should press the button ”I authenticate”. You should not get an error message.
- You will be redirected back to the page: https://demo.bankid.com/MainMenu.aspx. Here you can also test the function ”Sign” by pushing the button Sign.
- The BankID-app will again start in a window – This time with an user defined text to sign, select the test user and enter the user password and press the ”I Sign”-button.
- If the BankID app does not work use this link: https://https://support.bankid.com/sv/fixa to completely uninstall the BankID app and try again.