Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

133
Vistas
How to access localhost access token after redirect using react-native?

I am trying to access the fitbit API through oAuth on react-native. User login via fitbit works and after this, localhost is redirected and the access token is shown within the endpoint on the browser.

The issue i am facing currently is how can i get this access token from the browser in order to start fetching data from the fitbit api using the users access token within an android react-native application?

I am currently generating the oauth url and allowing the user to login. The issue is that after login is successful, there is no way i can retrieve the access token.

function OAuth(client_id, cb) {
    const oauthurl = `https://www.fitbit.com/oauth2/authorize?${qs.stringify({
        client_id,
        response_type: "token",
        scope: "heartrate activity activity profile sleep",
        redirect_uri: "http://localhost",
        expires_in: "31536000",
    })}`;
    console.log(oauthurl);
    // Linking.openURL(oauthurl).catch((err) =>
    //  console.error("Error processing linking", err)
    // );
}

After login is successful, this is the url i get back in the browser which contains the access token:

http://localhost/#access_token=eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiIyM0JCSzUiLCJzdWIiOiI5TEJSUEMiLCJpc3MiOiJGaXRiaXQiLCJ0eXAiOiJhY2Nlc3NfdG9rZW4i2IK2F0fX1UuuIwZDbc4&user_id=9LBRPC&scope=sleep+heartrate+profile+activity&token_type=Bearer&expires_in=31534747

As mentioned previously, how can i get this access token back into my application to be used?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda