Hi,
Each user with the IsActive property set to true is counted as a user for the User license.
You can programattically set the InActive property to false or back to true with for example a timer.
This you could use to set users inactive after a period of thime since their last login.
You could change your login logic to check if a user logs in who's inactive property is false and decide to activate the user again by changing the IsActive property to true.
If you use an external IAM like AzureAD than you still need an Internal User in OutSystems so yes youneed to by an additional 4900 user lincenses,
Regrards,
Daniel