Migrate between sign-in providers
Move users to another sign-in provider, so that each user keeps their projects.
Each project belongs to the account of one user. A new sign-in providersign-in provider — A configured way for users to sign in to the Backend: single sign-on (SSO), LDAP or a static list of users. One Backend can have more than one. Glossary usually gives other logins
than the old one, so the BackendBackend — The server program of Platforma. It keeps the projects, runs the Blocks and starts jobs. Glossary must find the old account of each user. Else the first sign-insign in — To show the Backend who you are, with a sign-in provider or a single-user token. The verb is "sign in"; the noun and the adjective are "sign-in". Glossary
with the new provider makes a new, empty account (with createUsers: true), or the Backend refuses
the user. For how the Backend finds an account, see
How the Backend finds the account of a user.
There are three ways to keep the projects of users in a move, for example from a static liststatic list of users — A sign-in provider that is a file with the logins and the password hashes of the users, in the htpasswd format. The Backend reads it again when it changes. Glossary of users to LDAPLDAP — The directory of users of a company. The Backend can check logins and passwords in it. Glossary, or from LDAP to SSOsingle sign-on — Sign-in through the identity service of the company, with the same account as for other company systems. Glossary:
- Mapping file: a file adds email addresses.
- Mapping by attributes: the new provider gives known values.
- Move projects: an administrator moves the projects.
The ways can work together: for example, a mapping file for most users, and a move of projects for a user who signed in with the new provider before the mapping. An installation made with the AWS installer or the Google Cloud installer cannot use the mapping file, because these installers do not give extra options to the Backend: see its installation page.
Before you start
- Make a backup of the database: see Make a backup now.
- Decide the login that the new provider gives. An LDAP provider gives the login that the user
types. An SSO provider gives the claim in
map.login, or, without it, the ID of the user at the identity provider (sub), which is a long value that people cannot read. MiLaboratories recommends to map the login to a readable claim, for exampleemail. A later change of the login gives users new accounts, so decide it now. - Plan to keep the old provider. Add the new provider next to the old one: users can then sign in both ways, move one by one, and keep a way back. When you add a provider, all sessions end, and all users sign in again; the projects stay. See Change the sign-in settings.
- Give the administrator roleadministrator role — The role in the Backend that can read and change the data of all users and run the pl-cli administrator commands. The operator sets rules that give it to users by login, group or attribute. Glossary for the new provider. The administrator rules (
adminUsers,roles) belong to each provider: write them with the logins or groups of the new provider. See Give the administrator role. - Keep an administrator who can sign in with the new provider.
pl-cli, which moves projects, signs in as this administrator withpl-cli login, with SSO or with a password.
Mapping file
Use this way when the old accounts do not have an email address, for example the accounts of a static list of users, and the new provider gives a verified email address. The file gives the email address of each old account. The new provider finds accounts by email, so the first sign-in with that email opens the old account with all its projects. The account keeps its old login. You need Backend 4.4.0 or later.
-
Write the mapping file. It is a CSV file with the columns
loginandemail. Add one row for each old login, with the email address that the new provider sends for that person. To get the list of logins, runpl-cli admin user-list.login,emailalice,alice@example.combob,bob.smith@example.com- Write each login exactly as the Backend has it. Logins are case-sensitive. A login that does not have an account makes a new, empty account with that email address.
- Leave out users who already signed in with the new provider: their email address belongs to their new account. Use Move projects for them.
- The Backend does not start when a row does not have a login, when a login or an email address is in two rows, or when an email address belongs to another account. Check the file before you give it to the Backend.
-
Put the file in a place that only administrators can change. A person who can change the file can connect any account to their own email address, also an administrator account.
Use a private bucket. Do not use the bucket of the primary storageprimary storage — The bucket (Amazon S3 or Google Cloud Storage) or folder where Platforma keeps all results and uploaded files. Glossary, because jobsjob — One run of a tool on data. The Backend starts jobs on the server where it runs, or in a Kubernetes cluster. Glossary can write to it, or the bucket of a data librarydata library — A folder or bucket with input data of the company. Users select files from it in the Desktop App. Platforma only reads it. Glossary, because users can see its files.
- Google Cloud Storage: give the service account of the Backend the role
roles/storage.objectVieweron the bucket. - Amazon S3: give the IAM role of the Backend
s3:GetObjecton the file. For S3-compatible storage, or without a role, make an access key that can read the file, and put it in a KubernetesKubernetes — A system that runs programs on a group of machines (a cluster). Platforma can run in a Kubernetes cluster. Glossary Secret in the namespace of the Backend.
Put the file on the server, for example
/etc/platforma/users.csv, with the ownerrootand the group of the system user of the Backend, mode640. - Google Cloud Storage: give the service account of the Backend the role
-
Give the file to the Backend, and let the new provider find users by email. The new provider gets
lookUpAttr: emailandmap.email. An LDAP provider must use search mode (bindDN): a direct bind cannot read the email attribute. When the Backend cannot read the file, it does not start.The option
--user-provisioningis not covered by the chart values or the module inputs: give it inextraArgs(Helm) orbackend_service.extra_args(Terraform). Give an S3 key inenv.secretVariables(backend_service.env.secret_variables): the chart refuses it inextraArgs. In Terraform, the provider fields are the same insnake_case(look_up_attr).values.yaml extraArgs:# Google Cloud Storage- --user-provisioning=gcs://<bucket>/<path>/users.csv- --user-provisioning-gcs-project-id=<project-id># Amazon S3. For S3-compatible storage: https://<endpoint>/<bucket>/<path>/users.csv# - --user-provisioning=s3://<bucket>/<path>/users.csv# - --user-provisioning-s3-region=<region># Only with an access key of step 2:# env:# secretVariables:# - name: PL_USER_PROVISIONING_S3_KEY# secret: { name: <secret-name>, key: <key-id-field> }# - name: PL_USER_PROVISIONING_S3_SECRET# secret: { name: <secret-name>, key: <secret-key-field> }auth:providers:- name: local # the old provider staystitle: "Local password"htpasswd:secret: { name: platforma-users, key: htpasswd }- name: corp # the new provider: LDAP in search modetitle: "LDAP directory"ldap:url: "ldaps://ldap.example.com:636"bindDN: "<bind-dn>"bindPassword: { name: <secret-name>, key: bind-password }# ... the other LDAP settingslookUpAttr: emailmap:email: mail# or an SSO provider:# - name: <provider-name># sso:# issuer: "<issuer-url>"# # ... the other SSO settings# lookUpAttr: email# map:# email: emailterraform.tfvars backend_service = {extra_args = [# Google Cloud Storage"--user-provisioning=gcs://<bucket>/<path>/users.csv","--user-provisioning-gcs-project-id=<project-id>",]# Only with an access key of step 2:# env = {# secret_variables = [# { name = "PL_USER_PROVISIONING_S3_KEY", secret = { name = "<secret-name>", key = "<key-id-field>" } },# { name = "PL_USER_PROVISIONING_S3_SECRET", secret = { name = "<secret-name>", key = "<secret-key-field>" } },# ]# }auth = {providers = [{name = "local" # the old provider staystitle = "Local password"htpasswd = { secret = { name = "platforma-users", key = "htpasswd" } }},{name = "corp" # the new provider: LDAP in search modetitle = "LDAP directory"ldap = {url = "ldaps://ldap.example.com:636"bind_dn = "<bind-dn>"bind_password = { name = "<secret-name>", key = "bind-password" }# ... the other LDAP settings}look_up_attr = "email"map = { email = "mail" }},]}}Add these options to the Backend service.
<provider-id>is the ID of the new provider. Declare the provider with the--auth.*options (--auth.provider-id,--auth.provider-type): the older--auth-ldap-*and--sso-idp-*options cannot find users by email.Terminal window --user-provisioning=file:///etc/platforma/users.csv \--auth.look-up-attr=<provider-id>=email \--auth.map.email=<provider-id>=mail # LDAP; for SSO: =email -
Add the new provider in the same change, and keep the old one. Do steps 3 and 4 in one upgrade or restart, before users sign in with the new provider.
-
Ask each user to sign in with the new provider. The first sign-in with an email address from the file opens the old account with its projects.
The Backend refuses an SSO sign-in by email when the identity provider does not mark the email address as verified. Microsoft Entra ID does not send this mark: set
trustUnverifiedEmail: trueon such a provider.
Consequences:
- Users keep their accounts, their projects and their old logins. Projects that other users shared with them stay shared.
- While the option is set, the Backend reads the file at each start, and does not start when it cannot read it or finds an error in it. Remove the option when all users have moved: see When all users use the new provider.
Mapping by attributes
Use this way when the new provider can give a value that the old accounts already have. Then you do not need a file or an extra option:
- The same login. By default (
lookUpAttr: login), the Backend finds the account with the login that the new provider gives. Setmap.loginof the new SSO provider so that it gives the old logins. for example A static list of users used email addresses as logins, and the SSO provider mapsloginto the claimemail. An LDAP provider gives the login that the user types, and cannot map it. - The same email address. Set
lookUpAttr: emailandmap.emailon the new provider: the Backend finds the account that has this email address. Old accounts have an email address only when the old provider stored one: an LDAP provider in search mode withmap.email, or an SSO provider withmap.email. Accounts of a static list of users, and of the older--auth-ldap-*options, do not have one: use the Mapping file for them.
-
Check the values. Run
pl-cli admin user-listto see the logins of the accounts, and compare them with what the new provider gives. -
Add the new provider next to the old one, with
mapandlookUpAttr:values.yaml auth:providers:- name: corp # the old provider staystitle: "LDAP directory"ldap:url: "ldaps://ldap.example.com:636"# ... the other LDAP settings- name: ssotitle: "Company SSO"sso:issuer: "<issuer-url>"clientID: "<client-id>"# ... the other SSO settingslookUpAttr: email # or leave it empty and set map.loginmap:email: emailterraform.tfvars backend_service = {auth = {providers = [{name = "corp" # the old provider staystitle = "LDAP directory"ldap = {url = "ldaps://ldap.example.com:636"# ... the other LDAP settings}},{name = "sso"title = "Company SSO"sso = {issuer = "<issuer-url>"client_id = "<client-id>"# ... the other SSO settings}look_up_attr = "email" # or leave it empty and set map.loginmap = { email = "email" }},]}}Terminal window --auth.look-up-attr=<provider-id>=email \--auth.map.email=<provider-id>=email# or: --auth.map.login=<provider-id>=<claim> -
Ask each user to sign in with the new provider. The first sign-in opens the old account with its projects. An SSO email address finds an account only when the identity provider marks it as verified (see
trustUnverifiedEmailin Mapping file).
Consequences:
- Users keep their accounts, logins and projects, also the projects that other users shared with them. You do not keep a file.
- The new provider decides who gets each account: a person to whom it gives the login or the verified email address of an old account gets that account with its projects. Use only a provider that your company controls for these values.
- A user whose value does not match gets a new, empty account (with
createUsers: true), or cannot sign in. Use Move projects for such users.
Move projects
Use this way when the new provider cannot give a value of the old accounts, or for a user who signed in with the new provider before the mapping. It works on every installation, also one made with an installer.
-
Make a list of the old login and the new login of each user. The new account must exist: the user signs in with the new provider one time, and gets a new, empty account.
-
Move the projects to the new account. Run these commands on a computer with Node.js 24 or later. The first command signs you in as an administrator, with the provider of your choice; see the pl-clipl-cli — The command-line client of Platforma. Administrators use it to manage users and projects on the Backend. Glossary tab of Connect clients:
Terminal window npx @platforma-sdk/pl-cli@latest login -a https://<platforma-address> --method <provider-id>npx @platforma-sdk/pl-cli@latest admin delete-user <old-login> \--move-projects-to <new-login>The command shows the projects of the old account and asks for a confirmation. It moves all projects, then deletes the old account. When the old provider still accepts this user, also take the user away there, for example delete the line from the static list of users.
Alternatives:
- To keep the old account until the user checks the new one, copy single projects with
pl-cli admin copy-project --source-user <old-login> --source-project <project> --target-user <new-login>(with the same session). Copy a project only when none of its BlocksBlock — A small application for one step of an analysis, for example the import of reads or clustering. It can combine several tools. Glossary runs. Then delete the old account withdelete-user --delete-projects. - A user who can still sign in with the old provider can share each project with the new account in the Desktop AppDesktop App — The program that each user installs on their own computer to work with Platforma. It is a client of the Backend. Glossary. The new account gets a copy of the project.
Consequences:
- You cannot undo
delete-user: the old account, its login and its email address go. - Projects that other users shared with the old account are not shared with the new account. Ask the owners to share them again.
- When the new account already has a project with the same name, the moved project gets a suffix.
When all users use the new provider
- Remove the mapping option (
--user-provisioning) when you used a mapping file. The accounts keep their email addresses. - Remove the moved users from the old provider, or remove the old provider. When you remove a provider, all sessions end, and all users sign in again.
- Keep one password login for emergencies, for example in a static list of users, for when the identity provider or the directory does not answer.