Skip to content

Commit

Permalink
Merge pull request #512 from DuendeSoftware/anders/IsUserActive
Browse files Browse the repository at this point in the history
Mention IsUserActive() on Asp.Net Identity page
  • Loading branch information
leastprivilege authored Sep 2, 2024
2 parents b14dec5 + a10ed2b commit 0f801d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions IdentityServer/v7/docs/content/aspnet_identity/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,7 @@ It also configures some of ASP.NET Identity's options for use with IdentityServe

If you need to use your own implementation of *IUserClaimsPrincipalFactory*, then that is supported. Our implementation of the *IUserClaimsPrincipalFactory* will use the decorator pattern to encapsulate yours. For this to work properly, ensure that your implementation is registered in the DI system prior to calling the IdentityServer *AddAspNetIdentity* extension method.

The *IUserProfileService* interface has two methods that IdentityServer uses to interact with the user store. The profile service added for Asp.Net Identity implements *GetProfileDataAsync* by invoking the *IUserClaimsPrincipalFactory* implementation registered in the dependency injection cotainer. The other method on *IProfileService* is *IsActiveAsync* which is used in various places in IdentityServer to validate that the user is (still) active. There is no built in concept in Asp.Net Identity to deactive users, so our implementation is simply hard coded to return *true*. If you extend the Asp.Net Identity user with enabled/disabled functionality you should derive from our *ProfileService<TUser>* and override *IsUserActiveAsync(TUser user)* to check your custom enabled/disabled flags.

## Template
Alternatively, you can use the *isaspid* [template]({{<ref "/overview/packaging#templates">}}) to create a starter IdentityServer host project configured to use ASP.NET Identity. See the [Quickstart Documentation]({{<ref "/quickstarts/5_aspnetid">}}) for a detailed walkthrough.

0 comments on commit 0f801d2

Please sign in to comment.