Skip to content

firebase.auth.Auth.onIdTokenChanged should return accessToken #294

Closed
@msukmanowsky

Description

@msukmanowsky

For applications requiring the accessToken from a provider to make further API requests to said provider (for example, making requests to various Google APIs), they can fetch the initial access token via getRedirectResult() or signInWithPopup(), since these both pass firebase.auth.UserCredential.

However, when an access token is periodically refreshed, there's no means to get a corresponding firebase.auth.UserCredential.

It seems as though since onIdTokenChanged is triggered for token refreshes where as onAuthStateChanged is not, that onIdTokenChanged should pass a firebase.auth.UserCredential instead of firebase.User.

Is there any other means to listen for changes to the accessToken upon refresh?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions