Login with google account inside my application

I want to login with google in my application (React Native application) without opening default web page from auth0. Please help me

Welcome to the Auth0 Community @andy.nguyendinh !

Social connections (like Google or Facebook) support only passive (browser-based) authentication flow because most social providers don’t allow a username and password to be entered into applications that they don’t own.

From your React app you can redirect users to the Google’s login page (skipping the Auth0’s hosted login form) by providing the connection parameter value to the /authorize request.

GET https://{yourDomain}/authorize?
  response_type=code|token&
  client_id={yourClientId}&
  connection=google-oauth2&
  redirect_uri={https: //yourApp/callback}&
  state=STATE&
  ADDITIONAL_PARAMETERS

Please let us know any other questions you may have on this topic!


I received this response when i tried your solution

Hi @andy.nguyendinh , Thank you for following up.

The result is be that a user goes directly to this login page:

instead of landing on the default Auth0’s login page in the first instance:

This looks good. In your Network requests list after authenticating, you should also see a request that contains tokens in the response:
POST https://subdomain.eu.auth0.com/oauth/token

Please let us know if there are any questions!

can you show me full api url of this api and the payload of it?

Hi @andy.nguyendinh ,

Additionally, if you intent to receive the Google’s access token, please take a look at this article: Identity Provider Access Tokens.

Thanks for supporting me. Could you please show me the payload? I need it to compare with mine

Are you using authorization code as grant_type?

And how we get the code?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.