googlecloudplatform / express-oauth2-handlers Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Per the Cloud Functions documentation, Node.js 10 and subsequent runtimes set fewer/different environment variables than previous runtimes. In particular, the FUNCTION_TRIGGER_TYPE environment variable no longer exists, and is replaced by the FUNCTION_SIGNATURE_TYPE variable instead.
This change causes non-HTTP triggered methods to be treated as if they were triggered by HTTP. While this can be corrected by manually setting FUNCTION_TRIGGER_TYPE, the library documentation warns against doing this.
Given that the Node.js 8 runtime will be deprecated June 5, 2020 and decommissioned Feb 15, 2021, the library should be adapted to work with Node.js 10+ runtimes.
null
as req
and res
parameter values (per the documentation).Error: Please pass Express' "req" and "res" objects to this function when using HTTP(S).
will be thrown.After following all of the steps in the tutorial, I am met with the error in the title when the auth callback route is called.
I am getting below error with this library version 0.1.2
[google-auth-library:DEP007] DeprecationWarning: The refreshAccessToken
method has been deprecated, and will be removed in the 3.0 release of google-auth-library. Please use the getRequestHeaders
method instead.
I am trying to use @google-cloud/express-oauth2-handlers package in Firebase function to authorize user to then query google APIs.
I provided the required keys in client_secret.json file in root directory of my function/app as per npm instructions for this package, however it's still not detecting the required keys from the client_secret.json file. Its throwing me below error.
firebase deploy --only functions
=== Deploying to 'doppelganger-appl'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
โ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error occurred while parsing your function triggers.
Error: Missing required keys: GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, GOOGLE_CALLBACK_URL, GCP_PROJECT
at exports.Provider.Provider.required (/Users//my-doppelganger-app/functions/node_modules/nconf/lib/nconf/provider.js:364:11)
at Object. (/Users//my-doppelganger-app/functions/node_modules/@google-cloud/express-oauth2-handlers/config.js:53:7)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/Users//my-doppelganger-
app/functions/node_modules/@google-cloud/express-oauth2-
handlers/tokenStorage.js:17:16)
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates are currently rate-limited. Click on a checkbox below to force their creation now.
eslint
, eslint-config-prettier
, eslint-plugin-node
, eslint-plugin-prettier
, prettier
)These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
package.json
@google-cloud/datastore ^3.1.0
@google-cloud/kms ^0.3.0
cookie ^0.3.1
google-auth-library ^3.1.0
googleapis ^37.2.0
nconf ^0.10.0
pify ^4.0.1
sha.js ^2.4.11
sinon ^7.2.3
tweetnacl ^1.0.1
tweetnacl-util ^0.15.0
ava ^1.2.1
eslint ^5.14.1
eslint-config-prettier ^4.0.0
eslint-plugin-node ^8.0.1
eslint-plugin-prettier ^3.0.1
nyc ^13.3.0
prettier ^1.16.4
proxyquire ^2.1.0
swap-case ^1.1.2
uuid ^3.3.2
node >=8
samples/package.json
node >=8
system-test/function/package.json
@google-cloud/datastore ^3.1.0
@google-cloud/kms ^0.3.0
cookie ^0.3.1
google-auth-library ^3.1.0
googleapis ^37.2.0
nconf ^0.10.0
pify ^4.0.1
sha.js ^2.4.11
sinon ^7.2.3
tweetnacl ^1.0.1
tweetnacl-util ^0.15.0
ava ^1.2.1
eslint ^5.14.1
eslint-config-prettier ^4.0.0
eslint-plugin-node ^8.0.1
eslint-plugin-prettier ^3.0.1
prettier ^1.16.4
proxyquire ^2.1.0
swap-case ^1.1.2
uuid ^3.3.2
node >=8
First of all thank you very much for the excellent package.
I think it is very useful and it deserves more attention within Google docs. I found it by chance while exploring this
I am trying to use to use this library in a Google Cloud function written in TypeScript.
Unfortunately Typescript is complaining it cannot find a type declaration.
I would like this package to export type declarations like other packages e.g.:
{
"name": "@google-cloud/functions-framework",
"version": "1.7.1",
"description": "FaaS (Function as a service) framework for writing portable Node.js functions",
"engines": {
"node": ">=10.0.0"
},
"repository": "GoogleCloudPlatform/functions-framework-nodejs",
"main": "build/src/index.js",
"types": "build/src/functions.d.ts",
...
Thank you very much for you work and thank you in advance if you'll find time to have a look at my request.
Filippo
Howdy y'all!
So I'm trying to get this to work while I have in my package.json "main": "src/index.js",
It seems to struggle to find the the client_secret.json file; thinking it's here: `/workspace/node_modules/@google-cloud/client_secret.json'. Is there a way to configure the location to look up a directory, or to tell it the path?
Thanks,
Kelly
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.