openiddict - 自定义流程 - 委托
问题描述
我想知道是否可以使用openiddict
类似于此处实现的委托授权类型来实现Identity Server
.
var result = await _validator.ValidateAccessTokenAsync(userToken);
if (result.IsError)
{
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant);
return;
}
是否有任何等效ValidateAccessTokenAsync
的方法来openiddict
验证令牌并访问其某些属性?
解决方案
https://github.com/openiddict/openiddict-core/issues/1249跟踪标准令牌交换的实施。
同时,您可以覆盖默认ValidateTokenParameter
处理程序以使用您的自定义授权并从您使用的客户参数中提取访问令牌:
IOpenIddictServerDispatcher.DispatchAsync()
然后,您可以使用 的实例调用该方法ProcessAuthenticationContext
来触发身份验证事件。如果IsRejected
是true
,这意味着令牌无效。否则,您将能够访问其声明主体。
推荐阅读
- algorithm - 在两个数组的联合中查找第 k 个最小的元素
- r - 如何重塑具有多个级别的数据框
- flutter - MediaQuery.of(context).padding 为零
- amazon-s3 - S3 www 到非 www 重定向将 /index.html 附加到 URL
- python - Python etree:从 CSV 创建嵌套 XML,按两个值分组
- android - 有没有办法通过复制文件/只修改文件系统来安装 Android 应用程序?
- python - Python 和导入
- android - 保存画布之前的绘图 - Android
- c++ - 知道何时指向对象更改
- azure - (Azure 数据工厂)如果列不存在,则聚合不起作用