【发布时间】:2020-08-14 16:05:46
【问题描述】:
我正在尝试使用已在 IdentityServer4 中实现的设备代码流,但在文档中,我找不到有关设备代码流的任何有用信息。我找到了一个设备代码流示例,但我不明白什么是用户代码,如何获取或保存它。
这是用于获取授权上下文的基本服务。
private readonly IDeviceFlowInteractionService _interaction;
public DeviceController(
IDeviceFlowInteractionService interaction)
{
_interaction = interaction;
_clientStore = clientStore;
_resourceStore = resourceStore;
_events = eventService;
_logger = logger;
}
private async Task<DeviceAuthorizationViewModel> BuildViewModelAsync(string userCode, DeviceAuthorizationInputModel model = null)
{
var request = await _interaction.GetAuthorizationContextAsync(userCode);
// Some code ...
return null;
}
正如您在上面看到的,我使用了具有参数 userCode 的 GetAuthorizationContext 但我不明白如何获取此代码?或保存在哪里。在文档中,我没有找到有关 UserCode 的任何信息。
【问题讨论】:
标签: asp.net asp.net-core identityserver4