Exchange a refresh token for an ID token
Source:R/frbs_exchange_refresh_token.R
frbs_exchange_refresh_token.RdRefreshes a Firebase ID token
Value
A named list with the following items:
expires_in: The number of seconds in which the ID token expires.token_type: The type of the refresh token, always "Bearer".refresh_token: The Firebase Auth refresh token provided, or a new refresh token.id_token: A Firebase Auth ID token.user_id: The uid corresponding to the provided ID token.project_id: Your Firebase project ID.error:NULLif no error code in responseA list of 2 if response was an error:
code: Error codemessage: Error message
Details
Visit Firebase Auth REST API docs for more details
Examples
if (FALSE) { # \dontrun{
# first sign in user and get the 'refresh_token':
user <- frbs_sign_in(email = "user@gmail.com", password = "password")
refresh_token <- user$refreshToken
# exchange the refresh token:
response <- frbs_exchange_refresh_token(refresh_token = refresh_token)
response
} # }