You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to use google-auth-library for a react app I am getting lots of errors that indicate missing dependencies. The errors are in the following format:
Module not found: Error: Can't resolve 'buffer' in '/private/tmp/minimal-example/node_modules/buffer-equal-constant-time'
The error messages include details on how to add a polyfill, but after going through each of these and adding the suggested polyfill the library still does not work, outputting the following error to the console:
GET http://metadata.google.internal./computeMetadata/v1/instance net::ERR_NAME_NOT_RESOLVED
Environment details
OS: macOs 12.0
Node.js version: 16.13.2
npm version: 8.1.2
google-auth-library version: 7.11.0
Steps to reproduce
Install Node 16.13.2
Create a react app npx create-react-app minimal-example
Enter directory for the created project cd minimal-example
Add the following code to ./src/App.js const {GoogleAuth} = require('google-auth-library');
Start the development server npm start
Observe errors
The text was updated successfully, but these errors were encountered:
sizlo
added
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
labels
Feb 8, 2022
bcoe
added
web
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
and removed
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
labels
Feb 8, 2022
We do not at this time support the browser without some manual work on the user's part (discussed in the issue above). We are, however, looking at adding this functionality.
May I ask what APIs you're hoping to interact with from the frontend?
I have a frontend react app and backend springboot app as separate services in the same Google App Engine instance. I want to be able to identify users based on their google account so have put an Identity-Aware Proxy in front of these services. This currently works fine for the react app, as the browser can present the login page for the user.
The problem I am trying to solve is being able to communicate from the frontend to the backend. When trying to send requests from the react app to the springboot app they fail with the 401 unauthorized status code. I found this stackoverflow thread which suggested this guide on authenticating with a service account as a way to solve this use case.
Is there a more recommended way to solve my use case?
When trying to use google-auth-library for a react app I am getting lots of errors that indicate missing dependencies. The errors are in the following format:
The error messages include details on how to add a polyfill, but after going through each of these and adding the suggested polyfill the library still does not work, outputting the following error to the console:
Environment details
google-auth-library
version: 7.11.0Steps to reproduce
npx create-react-app minimal-example
cd minimal-example
npm install google-auth-library --save
./src/App.js
const {GoogleAuth} = require('google-auth-library');
npm start
The text was updated successfully, but these errors were encountered: