【问题标题】:Expire user session using Firebase Authentication使用 Firebase 身份验证使用户会话过期
【发布时间】:2018-12-13 08:08:02
【问题描述】:

如何使用 AngularFireAuth 让登录到我系统的用户会话每 1 小时过期一次?

在我的系统配置中,我想让经过身份验证的用户能够配置会话过期的时间。

要登录系统,我使用以下代码。

  signIn(user: User) {
    return this.afAuth.auth.signInWithEmailAndPassword(user.email, user.password);
  }

我一直在查看文档,但我不知道如何将其应用于我的系统。 https://firebase.google.com/docs/auth/web/auth-state-persistence?hl=pt-br

我想通过 AngularFireAuth 了解如何执行此操作。 https://github.com/angular/angularfire2/blob/master/docs/auth/getting-started.md

【问题讨论】:

    标签: angular typescript firebase-authentication


    【解决方案1】:

    Firebase 身份验证会话不会过期,刷新令牌无限期有效。短暂的 ID 令牌会定期重新检查(大约每小时一次),但没有 API 来控制该过程成功的时间。

    不过,您有几个选择:

    【讨论】:

      猜你喜欢
      • 2020-03-09
      • 1970-01-01
      • 2012-05-04
      • 2016-05-29
      • 2018-10-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-20
      相关资源
      最近更新 更多