Starts in:
2 DAYS
6 HRS
58 MIN
42 SEC
Starts in:
2 D
6 H
58 M
42 S
Open Closed

Migrating existing User / Orginisation table to ABP/IdS #891


User avatar
-1
dmeagor created
  • ABP Framework version: 4.2
  • UI type: Blazor
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Seperated (Angular): yes

Aim

Import and consolidate the approx 250,000 users, from two different services (each has it's own server and database) into a new Tiered ABP solution.

Background

Our existing systems contain tables for Users and Organisations. Not all users are assigned to an organisation.

We aim to create Tenants for each user (single database multi-tenant model) based on either their organistion or individual User account if they are not part of an organisation. We are expecting to force users to reconfirm their accounts and generate new passwords (i've seen the article on passwordless logins which might help here.)

Question

Where are the methods to manage tenants, users, orgs?

Add tenants by code: Is it possible to create new tenants, users, organisations by code? If so can you please provide snippit of code that would create a new Tenant, Organisation, and Saas Users without triggering user welcome emails, and email validation etc. I want the validation to happen when they login, and not when we import. I know it's based on the ms identity/Signinmanager/IdS stuff but I've no idea how this all ties in with the Abp tenant/org/2fa code.

Delete old tenants (GDPR) Is there a proper way to delete tenants or do we have to hard code sql?

If you think this is the wrong approach and have a better idea then please let me know. We would consider SQL but the plan was for the Abp/Identity Server solution to run in a separate datacenter.

BTW. The identity docs are little more than headings and screenshots of the UI (you should just put this info into the UI itself!) Also are there .net API docs for your repositories, methods etc? I thought I saw some once but can't seem to find any now.


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Add tenants by code ....

    • For users, roles, you can refer : https://github.com/abpframework/abp/blob/dev/modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityDataSeeder.cs#L70

    • For tenantns, you can use TenantAppService.CreateAsync method. it will also initialize the tenant data. https://github.com/abpframework/abp/blob/dev/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/TenantAppService.cs#L52

    • For organisations, you can inject IOrganizationUnitManager to create , delete ... an organisation.

    Delete old tenants

    You just need to inject Repositpry and use DeleteAsync mehtod , like https://github.com/abpframework/abp/blob/dev/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/TenantAppService.cs#L94

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06