Open Closed

Resolve TenantName from CLI #1637


User avatar
0
JonasP created
  • ABP Framework version: v4.3.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I am referring to the support question https://support.abp.io/QA/Questions/53/Login-From-Desktop-Client. I'm writing a CLI project where the client enters username, password and tenantname to login. To login the correct user i have to get the TenantID by name before any user is logged in. To complete the task, I need to find an AppService that I can use to resolve Tenant-Name to tenant-ID (to be called from the CLI via HTTP) - like the login view.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

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

    HI,

    You mean use CLI to send a Http request to app service, right?

    See: https://docs.abp.io/en/abp/latest/Multi-Tenancy#tenant-resolvers

    Pass the tenant in the query string:

    httpClient.RequestTokenAsync(new TokenRequest()
    {
        Address = "https://demo.identityserver.io/connect/token?__tenant=xxx", pass the tenant
    
        GrantType = "password",
    
        ClientId = "client",
        ClientSecret = "secret",
    
        Parameters =
        {
            {"username", "xxx"},
            {"password", "xxx"}
        }
    });
    
    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 16, 2026, 14:50
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.