AbpProfileService.IsActiveAsync doesn't check if the user is Active
See original GitHub issueI’ve only just started using this boiler templates and its been good for a lot of things but I’m unsure of the issue with implementation of this code in the AbpProfileService
[UnitOfWork] public override async Task IsActiveAsync(IsActiveContext context) { var tenantId = context.Subject.Identity.GetTenantId(); using (_unitOfWorkManager.Current.SetTenantId(tenantId)) { await base.IsActiveAsync(context); } }
It doesn’t check if the user is active or not and hence my Identitysever4 integration always validates the user.
I thought referencing the class would automatically do the job or I’m I meant to use it as an example to implement my own logic. Apologies for my ignorance on the usage of some of this modules.
Here is the code where I have used the AbpProfileService class
services.AddIdentityServer() .AddDeveloperSigningCredential() .AddInMemoryIdentityResources(IdentityServerConfig.GetIdentityResources()) .AddInMemoryApiResources(IdentityServerConfig.GetApiResources()) .AddInMemoryClients(IdentityServerConfig.GetClients(configuration)) .AddAbpPersistedGrants<IAbpPersistedGrantDbContext>() .AddAbpIdentityServer<User>() .AddProfileService<AbpProfileService<User>>();
Please could someone explain the best approach to use the AbpProfileService such that it can check the user is inactive or Active? This is meant for IdentityServer4 intergration
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Awesome!
Please, however, see Brock’s response in my PR https://github.com/IdentityServer/IdentityServer4.AspNetIdentity/pull/59#issuecomment-414067474
On Sat, 18 Aug 2018, 16:53 Estar1, notifications@github.com wrote:
It should do. Impl is here https://github.com/IdentityServer/IdentityServer4.AspNetIdentity/blob/dev/src/ProfileService.cs
If you want to check if the user is locked out before issuing a token then change the logic here.
I’m unsure if it should. I’ll have to have a think about it. Does it make sense to restrict a locked out user from receiving tokens? Or does it make sense to issue a token from the STS since they are authenticated, then throw unauthorised if the user is inactive when trying to access protected resource.