【问题标题】:IdentityServer IsActiveAsync method not being called on the profile service未在配置文件服务上调用 IdentityServer IsActiveAsync 方法
【发布时间】:2016-07-29 14:12:50
【问题描述】:

我正在使用 IdentityServer v4 来处理我的 ASP.NET 应用程序的授权,使用资源所有者流。

我已经实现了IdentityServer4.Core.Services.IProfileService 接口,它有两个方法,GetProfileDataAsyncIsActiveAsync

向令牌端点发出请求时,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


    【解决方案1】:

    现在IsActiveAsync 不会被调用资源所有者密码请求。我猜假设如果用户处于非活动状态,您将无法成功验证用户身份。

    这些细节还没有决定——如果你对它应该如何工作有强烈的意见——请在 github 上打开一个问题。我们将在 8 月下旬锁定 API。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-10-30
      • 1970-01-01
      • 2022-08-18
      • 1970-01-01
      • 2023-04-08
      • 2018-09-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多