【发布时间】:2016-07-29 14:12:50
【问题描述】:
我正在使用 IdentityServer v4 来处理我的 ASP.NET 应用程序的授权,使用资源所有者流。
我已经实现了IdentityServer4.Core.Services.IProfileService 接口,它有两个方法,GetProfileDataAsync 和IsActiveAsync。
向令牌端点发出请求时,GetProfileDataAsync 会按预期调用。我们使用这种方法来发布我们的索赔。
但是IsActiveAsync 方法不会被调用。我想实现这个方法来确定用户是否在我们的数据库中处于活动状态。这个方法应该在什么时候被调用?
IdentityServer 源代码(见下文)中的注释表明它应该在令牌颁发期间被调用,但在请求令牌时不会调用该方法。我怀疑我错过了什么。任何帮助,将不胜感激。
// Summary:
// This method gets called whenever identity server needs to determine
// if the user is valid or active (e.g. if the user's account has been
// deactivated since they logged in). (e.g. during token issuance or
// validation).
Task IsActiveAsync(IsActiveContext context);
【问题讨论】:
标签: asp.net asp.net-web-api identityserver3 identityserver4