user managementinstallationmigrationusersdeveloper
Migrating Users Installation
It is possible to migrate a Bizzkit Users configuration from one instance to another. This could, for example, be done to migrate a customer from an on-prem solution to a Bizzkit cloud solution.
However it may also be a good time to review the organizations security setup. Setting up the new environment from the ground instead of migrating existing data could be serve as a healthy checkup.
This guide will assume that two instances of Bizzkit Users are available, an old source instance, and a new destination instance. It also assumes that the migrator is authorized in the Auth API.
Note
Username/password authentication is not possible in Bizzkit Users instance in the cloud. Client credentials are necessary to configure a Bizzkit Users instance.
Migrating users and roles through the API
To migrate an instance of Bizzkit User Management, several different entities have to be moved. This section walks through an example of C# code for migrating from a source IIamClient to a destination IIamClient.
At the top level, a method is called for migrating each type of data, which has to be moved.
Migrating downstream applications must be done with great care. Only import data that is actually needed. Do NOT migrate Bizzkit applications into the cloud.
Migrating protected APIs
Next, protected APIs are migrated by iterating over each protected API in the source instance and creating it in the destination instance.
New secrets can then be created for the machine client. This code snippet will simply print out the newly created secret, so the application using the machine client can be updated with the new secret.
Note
Generally, a client should only have one secret, except for when performing rolling deployment of secrets.
privatestaticasyncTaskMigrateMachineClientSecretsAsync(IIamClientsourceClient,IIamClientdestinationClient,stringid){Console.WriteLine($"Creating secrets for machine client with id {id}:");varclientSecrets=awaitsourceClient.ListMachineClientSecretsByIdAsync(id);foreach(varclientSecretinclientSecrets){varnewSecret=awaitdestinationClient.CreateMachineClientSecretAsync(id,newCreateClientSecretModel{Description=clientSecret.Description});Console.WriteLine("Created new client secret.");Console.WriteLine($"- description: {newSecret.Description}");Console.WriteLine($"- secret id: {newSecret.ClientSecretId}");Console.WriteLine($"- secret: {newSecret.Secret}");}Console.WriteLine();}
Migrating interactive applications
Like machine clients, to migrate interactive applications, it is necessary to register the client and create new secrets for the client.
New secrets can then be created for the interactive application. This code snippet will simply print out the newly created secret, so the application using the interactive application can be updated with the new secret.
Note
Generally, a client should only have one secret, except for when performing rolling deployment of secrets.
privatestaticasyncTaskMigrateInteractiveClientSecretsAsync(IIamClientsourceClient,IIamClientdestinationClient,stringid){Console.WriteLine($"Creating secrets for interactive client with id {id}:");varclientSecrets=awaitsourceClient.ListInteractiveApplicationSecretsByIdAsync(id);foreach(varclientSecretinclientSecrets){varnewSecret=awaitdestinationClient.CreateInteractiveApplicationSecretAsync(id,newCreateClientSecretModel{Description=clientSecret.Description});Console.WriteLine("Created new client secret.");Console.WriteLine($"- description: {newSecret.Description}");Console.WriteLine($"- secret id: {newSecret.ClientSecretId}");Console.WriteLine($"- secret: {newSecret.Secret}");}Console.WriteLine();}
Migrating Client side applications
Client side applications are migrated by iterating over each client side application in the source instance and creating it in the destination instance.