FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. prince.b
    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 3
    • Best 0
    • Controversial 0
    • Groups 0

    prince.b

    @prince.b

    0
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    prince.b Unfollow Follow

    Latest posts made by prince.b

    • Not getting enough details using Google Oauth

      Hi, I'm using fusion auth for my app. I've two IP integrated i.e. Discord and Google.

      For Discord I am getting enough details such as

        user: {
          id: '34343',
          discordId: '34434',
          email: 'email@myemail.com',
          image: 'https://imagelink.png',
          name: 'My Name'
        }
      

      However, with Google, I'm getting just an email and an id

       user: {
          id: '43434',
          email: 'email@myemail.com',
          image: undefined,
          name: undefined
        }
      

      In Fusion auth, I'm getting the details of user Google. Any idea why I am not able to receive these fields inside my application?

      Event Log:

      {
        "iss" : "hidden data",
        "azp" : "hidden data",
        "aud" :"hidden data",
        "sub" :"hidden data",
        "email" : "hidden data",
        "email_verified" : "hidden data",
        "at_hash" : "hidden data",
        "name" : "hidden data",
        "picture" : "hidden data",
        "given_name" : "hidden data",
        "family_name" :"hidden data",
        "iat" : "hidden data",
        "exp" : "hidden data",
        "alg" : "hidden data",
        "kid" : "hidden data",
        "typ" : "hidden data"
      }
      
      posted in Q&A
      P
      prince.b
    • RE: Getting error in Google Oauth integration

      @mark-robustelli Yes, im trying to do the same.

      posted in Q&A
      P
      prince.b
    • Getting error in Google Oauth integration

      Hi there, im using fusion auth for my app. I've been using FA(fusion auth) for discord but now I want to have google login as well. For this, i've created a new identity provider inside FA.

      I need access token from google and im using FA for this. Below is the code for it.

      const response = await fetch(
        `${process.env.FUSIONAUTH_URL}/api/identity-provider/login`,
        {
          headers: {
            "Content-Type": "application/json",
          },
          method: "POST",
      
          body: JSON.stringify({
            applicationId: process.env.FUSIONAUTH_CLIENT_ID,
            identityProviderId: process.env.FUSIONAUTH_GOOGLE_PROVIDER_ID,
            data: {
              code: context.params.code,
              redirect_uri: context.provider.callbackUrl,
            },
          }),
        }
      );
      

      I'm getting error in event logs. Logs:

      2/14/2024 11:22:31 AM Z Using code and redirect_uri with login method UseRedirect:
      2/14/2024 11:22:31 AM Z Call the [https://oauth2.googleapis.com/token] endpoint.
      2/14/2024 11:22:31 AM Z Endpoint returned status code [400]
      2/14/2024 11:22:31 AM Z The response was not successful, see the error event log.
      
      Request to the [https://oauth2.googleapis.com/token] endpoint failed.
      Status code [400]
      
      Error response is 
      {
        "error" : "invalid_grant",
        "error_description" : "Missing code verifier."
      }
      

      Could anyone help? I've tried multiple things none worked.
      I've tried adding grant_type and code_verifier as query params to FA url, it didn't worked. Like this:

       const url = `${process.env.FUSIONAUTH_URL}/api/identity-provider/login?code_verifier=${context.checks.code_verifier}`
      
      posted in Q&A
      P
      prince.b