Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when generating token using generate_token_v2.js #195

Open
rsiggins opened this issue Oct 18, 2024 · 2 comments
Open

Error when generating token using generate_token_v2.js #195

rsiggins opened this issue Oct 18, 2024 · 2 comments

Comments

@rsiggins
Copy link

I decided to rebuild my MM from scratch. The previous installation was using MMM-GooglePhotos without problems. I downloaded the credentials.json for an existing project from Google and attempted to run node generate_token_v2.js and got the following errors:

_pi@raspberrypi:~/MagicMirror/modules/MMM-GooglePhotos $ node generate_token_v2.js
/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/@google-cloud/local-auth/build/src/index.js:52
throw new Error(invalidRedirectUri);
^

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 (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/@google-cloud/local-auth/build/src/index.js:52:15)
at generate (/home/pi/MagicMirror/modules/MMM-GooglePhotos/generate_token_v2.js:32:24)
at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-GooglePhotos/generate_token_v2.js:46:1)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
at node:internal/main/run_main_module:23:47

Node.js v20.9.0_

I tried using the credentials.json from the previous installation and get the same errors.

I have been looking for other instances of this problem and have been unsuccessful. Any suggestions on where to look to correct this?

Richard

@hermanho
Copy link
Owner

Is it a "Desktop app" when creating OAuth client ID?

@rsiggins
Copy link
Author

Yes. After I posted this I, discovered Google is changing the API in April 2025 and may break MMM-GooglePhotos. I switched to wallpaper and a NFS fileshare. Much simpler and does not depend on Google.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants