Open Closed

Set Tenant on HttpClientToken authentication #4016


User avatar
0
andmattia created
  • ABP Framework version: v5.3.1
  • UI type: Angular / WinFomr
  • DB provider: EF Core * Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I try to login from winfrom using IIdentityModelAuthenticationService it works fine on host but how can I set the tenant? How can get tenat Id from name?

using (var cs = _provider.CreateScope())
                {
                    _tenant.Change(myTenantGuid, txtTenant.Text);


                    AsyncHelper.RunSync(() =>
                        _tokenManager.ObtainAccessToken(txtUser.Text, txtPassword.Text, txtUrl.Text));
                    var q = AsyncHelper.RunSync(() => _appService.GetAsync());
                   
                }

1 Answer(s)
  • User Avatar
    0
    gterdem created
    Support Team Senior .NET Developer

    Can you check the response headers? If you are logging as a tenant user, response should have tenant information.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11