Code Monkey home page Code Monkey logo

Comments (9)

danielbankhead avatar danielbankhead commented on June 18, 2024 1

I'm just trying to access a google account's profile information that's all. Am I correct to use the latter one or this library/repo would help me achieve the same?

I would recommend Google Sign in for this use case:

Related: We’re exploring alternative runtime support, including browsers, for this library. This will be useful for things like admin panels where the customer is a member of a GCP org. This can be tracked here:

from google-auth-library-nodejs.

noamolat-fs avatar noamolat-fs commented on June 18, 2024 1

I'm just trying to access a google account's profile information that's all. Am I correct to use the latter one or this library/repo would help me achieve the same?

I would recommend Google Sign in for this use case:

Related: We’re exploring alternative runtime support, including browsers, for this library. This will be useful for things like admin panels where the customer is a member of a GCP org. This can be tracked here:

Thank you for pointing me in the right direction. I made it work 😁 !

from google-auth-library-nodejs.

danielbankhead avatar danielbankhead commented on June 18, 2024 1

@zieru

I don't have an idea why proxy agent get executed in the browser.

This library is currently is not designed for the browser. That can be tracked here:

For browser usage today, I would recommend:

from google-auth-library-nodejs.

danielbankhead avatar danielbankhead commented on June 18, 2024

Hey @MorpheusZI,

This sounds like a duplicate of this issue:

Looking at the error message in the log you posted, it looks like somehow http.Agent is undefined here:

https://github.com/TooTallNate/proxy-agents/blob/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7/packages/agent-base/src/index.ts#L29C1-L29C49

Perhaps this is an issue with the bundler or configuration you are using?

from google-auth-library-nodejs.

noamolat-fs avatar noamolat-fs commented on June 18, 2024

Something similar happens on my end.
image

This is my code. I'm simply just importing the client.

import { OAuth2Client } from 'google-auth-library';

I'm using create-vue with Typescript with untouched configs for vite and TS.

from google-auth-library-nodejs.

danielbankhead avatar danielbankhead commented on June 18, 2024

@noamolat-fs this sounds like a bundler issue rather than an issue with this library. I’m not sure how else http.Agent wouldn’t exist here (referenced in the error message):

https://github.com/TooTallNate/proxy-agents/blob/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7/packages/agent-base/src/index.ts#L29C1-L29C49

from google-auth-library-nodejs.

noamolat-fs avatar noamolat-fs commented on June 18, 2024

@noamolat-fs this sounds like a bundler issue rather than an issue with this library. I’m not sure how else http.Agent wouldn’t exist here (referenced in the error message):

https://github.com/TooTallNate/proxy-agents/blob/b133295fd16f6475578b6b15bd9b4e33ecb0d0b7/packages/agent-base/src/index.ts#L29C1-L29C49

I'm having a hard time with what should I use. I've found these two libraries:

I was thinking that the issue above was a dependency issue so I switched to the latter, somehow I'm able to access it but now I have a problem with the global type for gapi. It's not being recognized by typescript even after installing @types/gapi but clearly there's a value for it.

I'm just trying to access a google account's profile information that's all. Am I correct to use the latter one or this library/repo would help me achieve the same?
I'm doing the requests in my Vue app with some sort of service scripts (typescript).

I switched to the last one because I thought the nodejs being referred was for the backend stuff and as mentioned I'm doing frontend.

Sorry for the unrelated subjects since I'm just trying to give a better insight into what I'm trying to do. Feel free to just focus on what's related.

from google-auth-library-nodejs.

danielbankhead avatar danielbankhead commented on June 18, 2024

Closing this as it appears to be a build tool issue unrelated to this library.

from google-auth-library-nodejs.

zieru avatar zieru commented on June 18, 2024

using this library only to make google-spreadsheet works by using JWT from service account, unfortunately I get this error too.
I don't have an idea why proxy agent get executed in the browser.

Building my own api call to get access_token from google is too much works.

from google-auth-library-nodejs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.