Open Closed

Disabling Changing Concurrent Login Option For Tenants #7484


User avatar
3
kkmy created

Hello,

With the version 8.2.0, you have provided the feature of changing the behavior for the concurrent login ("Disabled", "Logout from same type devices" and "Logout from all devices"). However, this option can be changed by each tenant admin under the settings menu.

How can I set the behavior for all the tenants as superadmin (admin without a tenant) and make sure that tenant admins cannot change it in any case?

Thank you.

  • ABP Framework version: v8.2.0
  • UI Type: Angular
  • Database System: EF Core (PostgreSQL)

7 Answer(s)
  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    How can I set the behavior for all the tenants as superadmin (admin without a tenant)

    Get IdentityProSettingNames.Session.PreventConcurrentLogin definition and change the default value in your SettingDefinitionProvider

    new SettingDefinition(IdentityProSettingNames.Session.PreventConcurrentLogin,
       IdentityProPreventConcurrentLoginBehaviour.Disabled.ToString(),
       L("DisplayName:Abp.Identity.PreventConcurrentLogin"),
       L("Description:Abp.Identity.PreventConcurrentLogin"),
       true)
    

    make sure that tenant admins cannot change it in any case?

    You can override the UpdateSessionAsync method of IdentitySettingsAppService to ensure that only the host admin can change it.

  • User Avatar
    0
    kkmy created

    Thanks for the reply. I have done what you have suggested and it works perfectly.

    1. Is it possible to hide this Sessions tab without overriding the Angular component? It would be the best if I can just override the GetList method and remove this tab.
    2. To be a reference for the people who are looking for a similar functionality, the part "IdentityProPreventConcurrentLoginBehaviour.Disabled.ToString()" does not disable the concurrent login, it disables the functionality to prevent concurrent login. You have to give either "LogoutFromAllDevices" or "LogoutFromSameTypeDevices" options to prevent. I just wanted to clarify as the term can be confusing.
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Is it possible to hide this Sessions tab without overriding the Angular component? It would be the best if I can just override the GetList method and remove this tab.

    I'm not sure about angular. You can try to set IsVisibleToClients of IdentityProSettingNames.Session.PreventConcurrentLogin to fasle

    To be a reference for the people who are looking for a similar functionality, the part "IdentityProPreventConcurrentLoginBehaviour.Disabled.ToString()" does not disable the concurrent login, it disables the functionality to prevent concurrent login. You have to give either "LogoutFromAllDevices" or "LogoutFromSameTypeDevices" options to prevent. I just wanted to clarify as the term can be confusing.

    Thanks 👍

  • User Avatar
    0
    kkmy created

    I'm not sure about angular. You can try to set IsVisibleToClients of IdentityProSettingNames.Session.PreventConcurrentLogin to fasle

    Unfortunately, this does not work. Do you have any other suggestions or is it not provided in the framework?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Then I guess you have to override the setting component.

  • User Avatar
    0
    kkmy created

    Ok then thank you.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13