Skip to Content
How-to guides

Go from test to production

Get your organization's BankID certificate and create a production client for sajn ID Inloggning

A test client can't become a production client. To go live, you get a BankID certificate for your organization, create a production client next to your test client, and point your production app at it.

Before you begin

  • Your integration works against a test client. See Test your integration.
  • You know the https redirect URIs of your production app, or the custom scheme of your native app.

1. Get your BankID certificate

A production client always runs on your organization's own BankID certificate. The BankID app then shows your company's name, not sajn's.

Contact sajn and ask for a BankID certificate for sajn ID Inloggning. sajn orders the certificate with you, checks it against BankID, and uploads it. You don't handle the certificate file yourself.

To check that the certificate is in place, open Inställningar > Utvecklare > sajn ID Inloggning and click Ny klient. Under Miljö, Produktion can be selected. While your organization has no usable certificate, the option is turned off and says Produktion kräver ett eget BankID-certifikat. Kontakta sajn så hjälper vi dig.

2. Create the production client

  1. In the Ny klient dialog, under Miljö, select Produktion.
  2. In Namn, enter the name your users know your app by.
  3. Under Adresser vi skickar användaren tillbaka till, add your production redirect URIs. A production client accepts https URIs and custom schemes, not http.
  4. Under Uppgifter klienten får hämta, select the same scopes as on your test client.
  5. Click Skapa klient.
  6. Copy the Client ID and the Client secret from the Klienten är skapad dialog. The secret is shown only this once.

The client's page shows Produktion and the line BankID visar followed by the company name in your certificate. If it says Inget användbart certifikat. Inloggningar nekas., contact sajn.

If you use private_key_jwt, register your keys on the new client now. See Authenticate with private_key_jwt. To match the hosted page to your brand, see Customize the hosted page.

3. Configure your production app

  1. Set the production client_id and secret in your production configuration. The issuer stays https://id.sajn.se.
  2. If you use the Session API or the login webhooks, make your production code accept only "environment": "PRODUCTION".
  3. Deploy.

Keep the test client for development and your test environments. The two clients give the same person different sub values, so never let test data and production data share user records.

4. Check the first real login

  1. Sign in to your production app with a real BankID.
  2. In the BankID app, check that the company name is yours.
  3. In the dashboard, open the production client's Logg tab. The login is listed as Slutförd.

From now on, every completed login on the production client counts against the logins in your plan. See Check a client's logins and usage.

Was this page helpful?

Last updated on