Skip to content

gdrive ouath redirect_uri failure #1289

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

Open
izaacdb opened this issue Apr 6, 2025 · 2 comments
Open

gdrive ouath redirect_uri failure #1289

izaacdb opened this issue Apr 6, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@izaacdb
Copy link

izaacdb commented Apr 6, 2025

Describe the bug
Instructions on https://github.com/modelcontextprotocol/servers/tree/main/src/gdrive do not work, oauth redirect 404s.

To Reproduce
Steps to reproduce the behavior:

  1. Follow instructions
  2. Run docker with docker run -i --rm --mount type=bind,source=/path/to/gcp-oauth.keys.json,target=/gcp-oauth.keys.json -v mcp-gdrive:/gdrive-server -e GDRIVE_OAUTH_PATH=/gcp-oauth.keys.json -e "GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json" -p 3000:3000 mcp/gdrive auth
  3. Follow oauth link
  4. Log in
  5. This site can't be reached on redirect_uri

Expected behavior
Logging in to work

Logs
None

Additional context
Looks like docker only exposes 3000 but the redirect_uri is set to trying http://localhost:37423/ . Tried exposing 37423 but no luck

@izaacdb izaacdb added the bug Something isn't working label Apr 6, 2025
@vivibui
Copy link

vivibui commented Apr 8, 2025

I am having the same issue

@kdevkr
Copy link

kdevkr commented Apr 10, 2025

🔥 The document is not friendly. 🔥

  • Use random port with keyFile.installed in @google-cloud/local-auth
  • Change the installed key in the gcp-oauth.keys.json file to web.
  • then, the server receives 3000 port.

before

{
  "installed": {
    "client_id": "YOUR_CLIENT_ID",
    "project_id": "YOUR_PROJECT_ID",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_secret": "YOUR_CLIENT_SECRET",
    "redirect_uris": ["http://localhost"]
  }
}

after

{
  "web": {
    "client_id": "YOUR_CLIENT_ID",
    "project_id": "YOUR_PROJECT_ID",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_secret": "YOUR_CLIENT_SECRET",
    "redirect_uris": ["http://localhost"]
  }
}

Results

❯ docker run -i --rm --mount type=bind,source=/Users/mambo/mcp-servers/gcp-oauth.keys.json,target=/gcp-oauth.keys.json -v ./mcp-gdrive:/gdrive-server -e GDRIVE_OAUTH_PATH=/gcp-oauth.keys.json -e "GDRIVE_CREDENTIALS_PATH=/gdrive-server/credentials.json" -p 3000:3000 mcp/gdrive auth

Launching auth flow…
(node:1) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Open this URL in your browser: https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F&access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.readonly&response_type=code&client_id=xxxx
Credentials saved. You can now run the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants