身份服务器 4 AuthorizationContext.PromptModes 空

Identity Server 4 AuthorizationContext.PromptModes empty

我正在使用oidc-client library to authorize with our own Identity Server 4。它工作正常,我需要扩展登录功能。我想使用 OIDC 参数“提示”。参数已正确发送到 connect/authorize 端点。调用登录方法时,我试图通过调用

来获取 AuthorizationContext
        var context = await _interaction.GetAuthorizationContextAsync(vm.ReturnUrl);
        var prompt = context.PromptModes;

_interaction 是 IIdentityServerInteractionService 的一个实例。 PromptModes 总是空的。这是我尝试访问它们的正确方式吗?

谢谢

您似乎在不适当的地方检查了值。 similar question on Github 的答案是:

we have to remove the prompt parameter because we would otherwise run into an endless loop. You could save the parameter in a separate parameter I guess.