The provided keyfile does not define a valid redirect URI.
See original GitHub issuehttps://github.com/googleapis/google-api-nodejs-client/blob/master/samples/drive/list.js doesn’t work
root@docker:~/gg# cat oauth2.keys.json
{
"web" : {
"redirect_uris": [
"https://hello.example.net"
],
"client_id": "10xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxontent.com",
"client_secret": "5fS6xxxxxxxxxxxxxxxxxxf0w",
"project_id": "maxxxxxxxxxxxxxx76211"
}
}
root@docker:~/gg# node e.js
Error: The provided keyfile does not define a valid
redirect URI. There must be at least one redirect URI defined, and this sample
assumes it redirects to 'http://localhost:3000/oauth2callback'. Please edit
your keyfile, and add a 'redirect_uris' section. For example:
"redirect_uris": [
"http://localhost:3000/oauth2callback"
]
at authenticate (/root/gg/node_modules/@google-cloud/local-auth/build/src/index.js:56:15)
at runSample (/root/gg/e.js:11:22)
at Object.<anonymous> (/root/gg/e.js:25:3)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789: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 Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
what’s wrong?!
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error: The provided keyfile does not define a valid redirect URI
i am a beginner in node.js and find it hard to figure out what is. needed in order to make it work. i...
Read more >[Solved]-OAuth2: `redirect_uri` provided did not match what is ...
If the url during setup does not match what you send in the redirect_uri query ... Error: The provided keyfile does not define...
Read more >AAD - Getting "Invalid redirect URI" despite having it registered
AADSTS90023: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect ...
Read more >Solved: Receiving a "redirect_uri_mismatch" error when aut...
I'm trying to use OAUTH 2.0 to authenticate/authorize. I'm testing on my local machine, where my application is running and accessible over HTTPS....
Read more >Google APIs Node.js Client - googleapis documentation
Make sure to store this file in safe place, and do not check this file into ... Google will redirect the page to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Taking a few steps back 😃 The sample you’re using is set up to allow showing an easy end to end workflow. In this workflow:
code
querystring parameter to set on theOAuth2
client.These are a lot of steps to just see bits flow through the wires 😃 We use the @google-cloud/local-auth module to abstract some of the messiness around standing up a web server, accepting an HTTP request from the redirect URI, and setting the credentials on the OAuth2 instances that is passed to the client. I think that’s what is tripping you up. If you want to use this in production, you really need to read through and understand the 3-legged OAuth2 flow described in the docs.
Hope this helps!
Thanks