How to add google sign in embedded login?

Hello,
I’m using my own ui to do sign-up & sign-in,
so i currently use embedded login, but i have no idea how to integrate correctly with google-signin

I dont want to use universal login or lock, since my client don’t want to redirect the page & have their own design

but then how do i register/sync account from google-oauth to auth0 ?
so my auth0 rules will be trigger and roles-creation will be applied,

im using Login using a social provider’s access token api: /oauth/access_token

    {
    'client_id': from auth0-application
    'access_token': from google-signin
    'connection': 'google-oauth2',
    'scope': 'openid profile email'
    }

but the return is 404, Not Found


I Assume the step are:

  • do google signin to get access-token of identity
  • call /oauth/access_token and pass access token of identity and receive access token of database
  • then when i want to get (for eg) userProfile, i use Bearer access token from above

now my concern also how to async the email from database with google sign-in
if I do google-signin with X@mail.com, I also still able to signup with X@mail.com , and in users i got 2 users with the same email

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

As of today, we don’t support native Google login. You may leave feedback at Auth0: Secure access for everyone. But not just anyone. for this feature. (Relevant note from one of our product managers is here.)

As a side note, if you want to mix Universal Login with embedded flows (E.g. Facebook Native), you may want to hide the Auth0’s hosted login page and redirect the user to Google’s login page directly for authentication. Skipping the hosted page is possible by passing the connection parameter.

For example, if you were implementing this with Swift for iOS, you may use the sample on this link. I’m taking the code below for quick reference.

Auth0
    .webAuth()
    .connection("google-oauth2")
    .audience("https://YOUR_DOMAIN/userinfo")
    .start { result in
        switch result {
        case .success(let credentials):
            print("Credentials: \(credentials)")
        case .failure(let error):
            print(error)
        }
    }
1 Like