refreshToken()

Description

Exchange refreshToken for idToken

Request

Parameters

FieldRequiredData TypeDescription

refresh_token

string

Refresh token obtained from sign-up or sign-in methods Examples: signInEmail() signUpEmail() signInOAuth()

Example

const idToken = await client.auth().refreshToken('AOEOulbFrpu25a7BwDxFzjPp67kenvwi3N7kJnXx6pCBaFMDWcBeHTTu1N_t6IGwxFm8lB44h2t2RD96Xcw2iMgvfMZCzkp8o6UJrCjjDQGjXOcO7u-wU5C3rZxUk5QvhWEvnxOpdIVJ5V7FRefWKfUzYVraIvgvTo3WnpbJ9Czx5IbadvknQxzfMt7OjCH7RfGrwEmA47huc-aoE2XZfLTOqRsfApKiHfaKAQtxNAie904p1lZEuMT2Ntss8fxTg61BrYvYO_XQr')

Response

Parameters

FieldData TypeDescription

user_id

string

UID of the user

idToken

string

refreshToken

string

Token that can be used to refresh idToken via refreshToken() method

expiresIn

string

How long the token is valid for (in seconds).

Example

{
    "data": {
        "expires_in": "3600",
        "refresh_token": "AOEOulbFrpu25a7BwDxFzjPp67kenvwi3N7kJnXx6pCBaFMDWcBeHTTu1N_t6IGwxFm8lB44h2t2RD96Xcw2iMgvfMZCzkp8o6UJrCjjDQGjXOcO7u-wU5C3rZxUk5QvhWEvnxOpdIVJ5V7FRefWKfUzYVraIvgvTo3WnpbJ9Czx5IbadvknQxzfMt7OjCH7RfGrwEmA47huc-aoE2XZfLTOqRsfApKiHfaKAQtxNAie904p1lZEuMT2Ntss8fxTg61BrYvYO_XQr",
        "id_token": "eyJahbGciOiJSUzI1NiIsImtpZCI6IjUwYTdhYTlkNzg5MmI1MmE4YzgxMzkwMzIzYzVjMjJlMTkwMzI1ZDgiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vZGVza3JlZS1mYzY3ODUyYy1jYTRlLTQ4MTQtYSIsImF1ZCI6ImRlc2tyZWUtZmM2Nzg1MmMtY2E0ZS00ODE0LWEiLCJhdXRoX3RpbWUiOjE2NT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