Skip to content

refresh id token periodically, same as access token #1614

Closed

Description

@tomholub

part of #1545

description here: FlowCrypt/flowcrypt-ios#1091

iOS implementation: https://github.com/FlowCrypt/flowcrypt-ios/pull/1225/files

browser extension implementation (simplified):

image

more context (browser extension) FlowCrypt/flowcrypt-browser#4194 (comment)

Activity

  1. DenBond7 commented on Dec 20, 2021

    @DenBond7
    Collaborator

    To do that we can use Google's library that uses GoogleSignInClient#silentSignIn() to fetch the latest version of SignIn data(that contains idToken) without a user action(silently). If silentSignIn() will fail we can ask a user to re-authenticate.

    That what I said means we don't need to find out how to refresh idToken manually. The library does it for us. I think we can close it.

  2. tomholub commented on Dec 20, 2021

    @tomholub
    CollaboratorAuthor

    Should also save the id token in memory each time we renew it. Else you'll have to get a fresh new token each time, I'm not sure if that's good.

    Unless google library caches it for you.

  3. DenBond7 commented on Dec 20, 2021

    @DenBond7
    Collaborator

    Unless google library caches it for you.

    Yes, it caches that data

  4. tomholub commented on Dec 20, 2021

    @tomholub
    CollaboratorAuthor

    ok to close in that case

  5. DenBond7 commented on Jan 24, 2022

    @DenBond7
    Collaborator

    After adding the last changes I started to test the whole process. It seems that fetching the last idToken on Android has interesting behavior. The Android library can return expired idToken but after a few attempts the library returns an updated idToken. I have to reinvestigate this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions