Open Closed

How to restrict the number of connections per User Account #4933


User avatar
0
david.hurtado created

We need to know if it is possible to restrict the number of concurrent logins that the same user can make in the application.

  • ABP Framework version: v7.0.1
  • UI type: Blazor Server
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

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

    Hi,

    We did not implement this function in ABP.

    I can give you some idea

    • When the user logins you can add a random GUID value to the claims, and store the GUID in the cache(can be a list, if you want to limit to allow only three concurrent logins, then the length of the list is 3 : https://docs.abp.io/en/abp/latest/Authorization#claims-principal-factory
    • Write an ASPNETCORE middleware to check the current user's claims, if the GUID value is not in the allowed list, return unauthorized
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.2.0-preview. Updated on January 09, 2026, 07:22
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.