我想知道是否可以实施openiddict
与实施的授权类型类似的授权授权类型here https://identityserver4.readthedocs.io/en/latest/topics/extension_grants.html with Identity Server
.
var result = await _validator.ValidateAccessTokenAsync(userToken);
if (result.IsError)
{
context.Result = new GrantValidationResult(TokenRequestErrors.InvalidGrant);
return;
}
有没有等效的方法ValidateAccessTokenAsync
in openiddict
为了验证令牌并访问它的一些属性?
标准代币交换的实施由以下方式跟踪https://github.com/openiddict/openiddict-core/issues/1249 https://github.com/openiddict/openiddict-core/issues/1249.
同时,您可以覆盖默认值ValidateTokenParameter
处理程序处理您的自定义授权并从您使用的客户参数中提取访问令牌:
https://github.com/openiddict/openiddict-core/blob/422d8979adb8cdebc6c8c8e14faa1d736208271e/src/OpenIddict.Server/OpenIddictServerHandlers.cs#L168 https://github.com/openiddict/openiddict-core/blob/422d8979adb8cdebc6c8c8e14faa1d736208271e/src/OpenIddict.Server/OpenIddictServerHandlers.cs#L168
然后,您可以调用IOpenIddictServerDispatcher.DispatchAsync()
具有实例的方法ProcessAuthenticationContext
触发身份验证事件。如果IsRejected
is true
,这意味着令牌无效。否则,您将能够访问其声明主体。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)