cookie 中的 Identityserver id_token 使 cookie 变大

Identityserver id_token in cookie makes cookie size large

我一直在将 id_token 放入授权 cookie 中,因为您在单点退出时需要此令牌。

notification.ProtocolMessage.IdTokenHint = 
    notification.OwinContext.Authentication.User.FindFirst("id_token").Value;

但是,它会使 cookie 变大。所以,我们在想,如果这是唯一一次我们需要它,那么将它存储在数据库中以供用户使用可能不是一个坏主意。这样,我们可以在注销之前检索它并将其发送到 ids,并且还将使授权 cookie 的大小保持较小。请指教

您可以随意将 id_token 存储在您认为合适的任何地方。仅在注销时需要。