AWS Cognito 刷新令牌未发生

时间:2021-02-22 14:33:48

标签: android kotlin amazon-cognito refresh-token

我在 Android 应用程序中通过 AWSMobileClient 使用 AWS Cognito,每次启动应用程序时,我都会检查有效的 AWS 令牌,但应用程序卡在启动时。

我查看了日志,发现AWS刷新令牌是死胡同,获取令牌刷新行后没有日志

private fun getAWSToken() : String {
    Sentry.capture("AWS token")
    return try {
        Sentry.capture("AWS token try")
        val token = AWSMobileClient.getInstance()?.tokens?.accessToken?.tokenString
        return if (token == null) {
            Sentry.capture("AWS token is nulled")
            ""
        } else {
            Sentry.capture("AWS token found")
            token
        }
    } catch (e: Exception) {
        Sentry.capture("AWS token try failed")
        Sentry.capture(e)
        ""
    }

}

AWS 令牌尝试后没有日志,我是否遗漏了什么或错误地使用了库?

0 个答案:

没有答案