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

id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com #6854

Closed
srameshr opened this issue Aug 10, 2020 · 2 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@srameshr
Copy link
Contributor

New Issue Checklist

Issue Description

oAuth login with Google fails because the TOKEN_ISSUER constant expects Google clientId passed inside Parse server init to have a different domain name than whats provided by Google.

if (jwtClaims.iss !== TOKEN_ISSUER) {
  throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, `id token not issued by correct provider - expected: ${TOKEN_ISSUER} | from: ${jwtClaims.iss}`);
}

Steps to reproduce

new ParseServer({
   ...yourOptions,
  auth: {
    google: {
      clientId: 'XXX-XXX.apps.googleusercontent.com',
    }
  }
});

Parse.User.linkWith('google', { authData: {id, client_id, access_token } });

Actual Outcome

verbose: RESPONSE from [POST] /parse/functions/post_sign_in: {
  "response": {
    "result": {
      "data": {
        "message": "id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com",
        "code": 101
      }
    }
  }
error: Parse error: id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com {"code":101,"stack":"Error: id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com\n    at verifyIdToken (node_modules/parse-server/lib/Adapters/Auth/google.js:91:11)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)\n    at async Promise.all (index 0)"}

Expected Outcome

Should login the user and provide sessionToken.

Environment

Server

  • Parse Server version: 4.3.0
  • Operating system: Mac OS
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): localhost

Database

  • System (MongoDB or Postgres): Mongo
  • Database version: 4.XX
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): localhost

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): JS
  • SDK version: 1.8.0

Logs

verbose: RESPONSE from [POST] /parse/functions/post_sign_in: {
  "response": {
    "result": {
      "data": {
        "message": "id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com",
        "code": 101
      }
    }
  }
error: Parse error: id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com {"code":101,"stack":"Error: id token not issued by correct provider - expected: https://accounts.google.com | from: accounts.google.com\n    at verifyIdToken (node_modules/parse-server/lib/Adapters/Auth/google.js:91:11)\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)\n    at async Promise.all (index 0)"}
@srameshr
Copy link
Contributor Author

@SebC99 Is this because of your recent commits? Any chance we can revert the commit to stop all these breaking cases?

@SebC99
Copy link
Contributor

SebC99 commented Aug 10, 2020

@srameshr there's already a merged PR for this one: #6836

@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants