【问题标题】:Resource owner password credential flow and "remebmer me" functionality (ie cookies)资源所有者密码凭证流和“记住我”功能(在 cookie 中)
【发布时间】:2017-05-18 22:28:56
【问题描述】:

我正在使用IdentityServer3 为新的ng2 Web 应用程序提供身份验证和授权。我的服务器端几乎就是https://github.com/IdentityServer/IdentityServer3.Samples/tree/master/source/AspNetIdentity/WebHost 提供的示例。

在客户端,我设置了一个登录页面,该页面使用password grant_typeroclient(资源所有者客户端)流,在成功调用POST /core/connect/token 后获取jwt。现在我将它保存到localStorage 并用于以后的调用。

我的问题如下:

  1. 如何实现“记住我”功能?我会使用刷新令牌来改变令牌的到期时间,还是会尝试以某种方式使用 cookie -

  2. IdentityServer3 中是否有内置方法可以从不记名令牌中获取 cookie?

【问题讨论】:

    标签: cookies oauth-2.0 jwt identityserver3 openid-connect


    【解决方案1】:
    1. 在 SPA 中“记住我”?使用 localStorage 是您唯一的选择。鉴于您决定使用资源所有者密码流,您不会从 SSO 中受益。如果您是 dong 重定向,那么您可以在 IdentityServer 上发出持久性 cookie,以实现更标准的“记住我”。

    2. 没有。

    【讨论】:

      猜你喜欢
      • 2013-11-23
      • 2015-01-06
      • 2019-01-03
      • 1970-01-01
      • 2015-08-16
      • 1970-01-01
      • 2014-03-31
      • 2015-05-20
      • 2014-09-02
      相关资源
      最近更新 更多