Open Closed

Framework not supporting the listed items. Need urgent help #2048


User avatar
0
abpdeveloper@dbizsolution.com created

The Architecture is configured as per the points listed below.

Step1: We have split the applications with common Identity Server. Step2: BIMS is one main application which handled users and their accesses Step3: BIMS_BDairy is another application which uses the Identity Server of BIMS

We need solution for addressing these points.

1)Tenant based login - AbpUsers, AbpUserRoles - StoreManager,Admin,HR - High level people

Step1: We will have tenants created in our main application (BIMS) Step2: We will have users created logins created against these tenants, Step3: At the Service level we need to validate this user with his credentials and allow access to the Service with the approriate tenant and user details set in the context.

This is not working now, it works only for Host login and not for Tenant Login. This needs to be addressed

2)Tenant based Token Generation for Login (API)- Mobile App

Step1: We are having a Mobile Application in which these tenant users will login using the mobile App using say EmployeeID and not his/her username or password Step2: We need to validate the user against the credentials and generate token to access the Services.

3)To Configure Roles in BIMS with BDairy Feature list.(Screen Permissions)

Step1: We have split the applications with common Identity Server. Step2: BIMS is one main application which handled users and their accesses Step3: BIMS_BDairy is another application which uses the Identity Server of BIMS Step4: How do i get the permission of BDairy in BIMS for the user to set access in the BIMS Application using the permissions tab

4)How to remove the Additional tables like AbpUsers in BIMS BDairy

Step1: We have split the applications with common Identity Server. Step2: BIMS is one main application which handled users and their accesses Step3: The same users,login,clients etc tables are created also in BDairy how to avoid this as this has to be at BIMS level and not in BDairy

5)How to do Redis Configuration

Step1:How to do Redis Configuration in Windows server for Production. Need documentations for the same.

6)HTTPS in deployment

Step1: When we deploy the AppServices BIMS and BDairy in IIS and configure https for these service, it throws as invalid uri exception. It works when we provide only Http. Step2: We have cross refernence calls like from BDairy AppService we will call a method in the BIMS AppService for fetching some data


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

    Hi,

    Tenant based login

    ABP provides multiple ways to determine the current tenant and allows custom tenant resolvers: https://docs.abp.io/en/abp/latest/Multi-Tenancy. I think it can help you.

    Tenant based Token Generation for Login (API)- Mobile App

    Actually, this is not related to ABP but IdentityServer, you can customize any grant type: https://identityserver4.readthedocs.io/en/latest/topics/extension_grants.html

    To Configure Roles in BIMS with BDairy Feature list

    As I said, you need to add the BDairy's application contract project reference to BIMS and add Add module dependencies.

    For example:

    [DependsOn(typeof(BDairyApplicationContractModule))]
    public class BIMSApplicationContractModule ...
    {
    }
    

    How to remove the Additional tables like AbpUsers in BIMS BDairy

    Open your DbContext and remove builder.ConfigureIdentity(); or anything you want do delete.

    How to do Redis Configuration

    Actually, I don't understand this question, I guess you want to install Redis on WinServer right? Redis does not provide an official Windows installation package, we recommend you to use linux as the redis server.

    HTTPS in deployment

    Can you share the logs?

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi,

    Tenant based login

    ABP provides multiple ways to determine the current tenant and allows custom tenant resolvers: https://docs.abp.io/en/abp/latest/Multi-Tenancy. I think it can help you.

    Tenant based Token Generation for Login (API)- Mobile App

    Actually, this is not related to ABP but IdentityServer, you can customize any grant type: https://identityserver4.readthedocs.io/en/latest/topics/extension_grants.html

    To Configure Roles in BIMS with BDairy Feature list

    As I said, you need to add the BDairy's application contract project reference to BIMS and add Add module dependencies.

    For example:

    [DependsOn(typeof(BDairyApplicationContractModule))] 
    public class BIMSApplicationContractModule ... 
    { 
    } 
    

    How to remove the Additional tables like AbpUsers in BIMS BDairy

    Open your DbContext and remove builder.ConfigureIdentity(); or anything you want do delete.

    How to do Redis Configuration

    Actually, I don't understand this question, I guess you want to install Redis on WinServer right? Redis does not provide an official Windows installation package, we recommend you to use linux as the redis server.

    HTTPS in deployment

    Can you share the logs?

    Hi . It would be better if we can have a screen sharing session as the documentation doesnt acutally help our needs.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I think you can try it first and reply here.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi,

    I think you can try it first and reply here.

    The documentation references provided is not helping out to solve my problem. Pls do a screen sharing.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Maybe you can create a simple project to reproduce and share it to me, as you know, the network is not good when we using zoom to connect.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    I have sent the details to you over email with screen shots. Pls this is very urgent.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I have checked your project, your architecture is actually wrong, this more has nothing to do with ABP but your architecture.

    Let me explain it:

    You have two applications, each with its own database, but you want to do data sharing, tenants, permissions, users, etc. this is impossible (you can create a copy of the data, but I think this is not what you want).
    Actually I think the microservice template is more suitable for you, or you should use BIMS_BDairy as a module instead of an application.

    However, I still solved your problem, please check your email, I have send the source code to you.

    How I solved it:

    1. Change the connect string to use BIMS database.

    1. Change BIMS_BDairyDbContext :
    [ConnectionStringName("Default")]
        public class BIMS_BDairyDbContext :
            AbpDbContext<BIMS_BDairyDbContext>
    {
        //  Remove all `ReplaceDbContext` and interface.
        //  Remove region `Entities from the modules`
    }
    
    1. Add BIMS_BDairy.Application.Contracts project to BIMS solution. and open BIMSApplicationContractsModule class:
    [DependsOn(
            ......
            typeof(BIMS_BDairyApplicationContractsModule)  // add this line
        )]
        public class BIMSApplicationContractsModule : AbpModule
    

    That's all.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    Point 1 - Works Fine.

    Point 3 - Still has issue.

    1. I have created a custom role and set permissions for the role.

    1. The permissions set are not reflected in the BIMS

    1. The permissions set are not reflected in the BIMS_BDairy

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I don't understand what is the permissions set are not reflected in the BIMS_BDairy and BIMS.

    But I forgot on thing that is you need to remove redis module.

    Have you received the source code I sent? is it work?

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    The Source code which you shared resolves the Point 1 in my requirement list, but the Point 3 doesnt work

    1. I have set of features in BDairy which needs to be set permission at the role level in BIMS, which I am able to set but doesnt reflect in the BDairy .

    Can we do a quick screen sharing, this will help to close this isssue

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    How I reproduce it? please provide the steps.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    How I reproduce it? please provide the steps.

    Pls refer the screen shots which I have attached in the ticket today.

    1. Login to BIMS
    2. Select Identity Management Menu - Role
    3. Select Role - Sales executive and click permissions
    4. UnSelect few permissions from BIMS and BIMS BDairy in the Permission Popup Model
    5. Logout and Login to BIMS using exec login

    username - exec password - Dbiz@123 6) The Features UnSelected are still shown( The Menu is not getting Hiding) in BIMS 7) Go to Home Page in BIMS and click abp.io in the Home Page it redirects to BIMS BDairy 8) The Unselected features are still shown in the BIMS BDairy and not hidden.

    Expected Result - If the Features are unselected those Menus Should be Hidden when logged in

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Sorry my bad, you should use redis both BISM and BISM_BDairy.

    appsettings.json

    ...
      "Redis": {
        "IsEnabled": true,
        "Configuration": "127.0.0.1"
      },
    ...
    
    [DependsOn(
            ......
            typeof(AbpCachingStackExchangeRedisModule)
            )]
        public class BIMSHttpApiHostModule : AbpModule
    
    [DependsOn(
           ....
            typeof(AbpCachingStackExchangeRedisModule)
            )]
        public class BIMS_BDairyHttpApiHostModule : AbpModule
    

    Remove the ConfigureCache method.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi,

    Sorry my bad, you should use redis both BISM and BISM_BDairy.

    appsettings.json

    ... 
      "Redis": { 
        "IsEnabled": true, 
        "Configuration": "127.0.0.1" 
      }, 
    ... 
    
    [DependsOn( 
            ...... 
            typeof(AbpCachingStackExchangeRedisModule) 
            )] 
        public class BIMSHttpApiHostModule : AbpModule 
    
    [DependsOn( 
           .... 
            typeof(AbpCachingStackExchangeRedisModule) 
            )] 
        public class BIMS_BDairyHttpApiHostModule : AbpModule 
    

    Remove the ConfigureCache method.

    Hi

    Should I configure redis locally. Note - Redis is not configured locally I have done the steps mentioned in your response, but I am getting this error when I start BIMS Host,, but BDairy is getting started even though Redis not configured locally.

    [13:47:09 WRN] It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 7s ago, v: 2.0.593.37019 StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 7s ago, v: 2.0.593.37019 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 823 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.GetAsync(TCacheKey key, Nullable1 hideErrors, Boolean considerUow, CancellationToken token) [13:47:18 WRN] It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 16s ago, v: 2.0.593.37019 StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 16s ago, v: 2.0.593.37019

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    Should I configure redis locally. Note - Redis is not configured locally I have done the steps mentioned in your response, but I am getting this error when I start BIMS Host,, but BDairy is getting started even though Redis not configured locally.

    [13:47:09 WRN] It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 7s ago, v: 2.0.593.37019 StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 7s ago, v: 2.0.593.37019 at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 823 at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAndRefreshAsync(String key, Boolean getData, CancellationToken token) at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.GetAsync(String key, CancellationToken token) at Volo.Abp.Caching.DistributedCache2.GetAsync(TCacheKey key, Nullable1 hideErrors, Boolean considerUow, CancellationToken token) [13:47:18 WRN] It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 16s ago, v: 2.0.593.37019 StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). UnableToConnect on 127.0.0.1:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 2s ago, last-write: 2s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 16s ago, v: 2.0.593.37019

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Are you sure the redis server is running?

    There is Redis msi, but it is not an official release and is only used for development and testing. https://github.com/tporadowski/redis/releases

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    Redis is running now and BIMS is started but still the permissions are not getting reflected getting this error.

    2021-11-02 17:42:39.149 +05:30 [INF] Request finished HTTP/2 GET https://localhost:44343/api/permission-management/permissions?providerName=R&providerKey=admin - - - 200 - application/json;+charset=utf-8 299.4798ms 2021-11-02 17:42:48.273 +05:30 [INF] Request starting HTTP/2 OPTIONS https://localhost:44343/api/permission-management/permissions?providerName=R&providerKey=admin - - 2021-11-02 17:42:48.273 +05:30 [INF] CORS policy execution successful. 2021-11-02 17:42:48.273 +05:30 [INF] Request finished HTTP/2 OPTIONS https://localhost:44343/api/permission-management/permissions?providerName=R&providerKey=admin - - - 204 - - 0.4803ms 2021-11-02 17:42:48.276 +05:30 [INF] Request starting HTTP/2 PUT https://localhost:44343/api/permission-management/permissions?providerName=R&providerKey=admin application/json 224 2021-11-02 17:42:48.276 +05:30 [INF] CORS policy execution successful. 2021-11-02 17:42:48.291 +05:30 [INF] Successfully validated the token. 2021-11-02 17:42:48.291 +05:30 [DBG] CORS request made for path: /api/permission-management/permissions from origin: http://localhost:4200 but was ignored because path was not for an allowed IdentityServer CORS endpoint 2021-11-02 17:42:48.291 +05:30 [INF] No CORS policy found for the specified request. 2021-11-02 17:42:48.296 +05:30 [INF] Executing endpoint 'Volo.Abp.PermissionManagement.PermissionsController.UpdateAsync (Volo.Abp.PermissionManagement.HttpApi)' 2021-11-02 17:42:48.305 +05:30 [INF] Route matched with {area = "permissionManagement", action = "Update", controller = "Permissions", page = ""}. Executing controller action with signature System.Threading.Tasks.Task UpdateAsync(System.String, System.String, Volo.Abp.PermissionManagement.UpdatePermissionsDto) on controller Volo.Abp.PermissionManagement.PermissionsController (Volo.Abp.PermissionManagement.HttpApi). 2021-11-02 17:42:48.306 +05:30 [DBG] Login Url: /Account/Login 2021-11-02 17:42:48.306 +05:30 [DBG] Login Return Url Parameter: ReturnUrl 2021-11-02 17:42:48.306 +05:30 [DBG] Logout Url: /Account/Logout 2021-11-02 17:42:48.306 +05:30 [DBG] ConsentUrl Url: /Consent 2021-11-02 17:42:48.306 +05:30 [DBG] Consent Return Url Parameter: returnUrl 2021-11-02 17:42:48.306 +05:30 [DBG] Error Url: /Account/Error 2021-11-02 17:42:48.306 +05:30 [DBG] Error Id Parameter: errorId 2021-11-02 17:42:48.320 +05:30 [INF] Authorization was successful. 2021-11-02 17:42:48.322 +05:30 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:a0850436-011c-d4b2-d0ee-39ff53dc8c3c,n:AbpIdentity.Roles.ManagePermissions 2021-11-02 17:42:48.322 +05:30 [DBG] Found in the cache: pn:U,pk:a0850436-011c-d4b2-d0ee-39ff53dc8c3c,n:AbpIdentity.Roles.ManagePermissions 2021-11-02 17:42:48.322 +05:30 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:AbpIdentity.Roles.ManagePermissions 2021-11-02 17:42:48.322 +05:30 [DBG] Found in the cache: pn:R,pk:admin,n:AbpIdentity.Roles.ManagePermissions 2021-11-02 17:42:48.322 +05:30 [DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:BIMS_App,n:AbpIdentity.Roles.ManagePermissions 2021-11-02 17:42:48.322 +05:30 [DBG] Found in the cache: pn:C,pk:BIMS_App,n:AbpIdentity.Roles.ManagePermissions 2021-11-02 17:42:48.322 +05:30 [INF] Authorization was successful. 2021-11-02 17:42:48.371 +05:30 [INF] Executed action Volo.Abp.PermissionManagement.PermissionsController.UpdateAsync (Volo.Abp.PermissionManagement.HttpApi) in 66.8574ms 2021-11-02 17:42:48.372 +05:30 [INF] Executed endpoint 'Volo.Abp.PermissionManagement.PermissionsController.UpdateAsync (Volo.Abp.PermissionManagement.HttpApi)' 2021-11-02 17:42:48.466 +05:30 [DBG] Added 0 entity changes to the current audit log 2021-11-02 17:42:48.466 +05:30 [DBG] Added 0 entity changes to the current audit log 2021-11-02 17:42:48.574 +05:30 [DBG] Added 0 entity changes to the current audit log 2021-11-02 17:42:48.574 +05:30 [DBG] Added 0 entity changes to the current audit log

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    HI,

    https://support.abp.io/QA/Questions/2048#answer-3581b895-ec32-90de-d43f-39fff2fea5a6

    You can see the application works in GIF, Did you config Redis in the BISM and BISM_BDairy? can you share a gif?

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Pls see the image where I have enabled Redis in BIMS and BDairy.

    It seems some other error, Can we do a screen sharing it will help to solve immediatelt

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    Please see here, I have created a new Role test and logged in as that user

    Pls see there is no permission set for BIMS or Saas

    But all menus in BIMS and Saas is also displayed, the permissions is not getting reflected.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    Please share the project to me again. thanks.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    Shared the source link over mail.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I used the project you provided, but I didn't get it. there is no problem.

  • User Avatar
    0
    abpdeveloper@dbizsolution.com created

    Hi

    Can you check adding and removing a permission in BIMS. It is not reflecting, it works for BDairy.

    Pls refer screen shot where the StaffMasters permission is removed in BIMS but still the Menu StaffMasters is loaded even after removed.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can you check adding and removing a permission in BIMS. It is not reflecting

    I checked, there is no problem. I didn't change anything. just run the project.

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