Skip to content

validateIdToken fails on new version #171

Open
@shaun-pendrigh

Description

Since upgrading from 4.0.0 to 4.1.2, validateIdToken fails with the following message:

SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at C:\Users\SPendrigh\Documents\Development\Officejs\sample\node_modules\intuit-oauth\src\OAuthClient.js:479:33
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async C:\Users\SPendrigh\Documents\Development\Officejs\sample\app.js:78:7
    at async C:\Users\SPendrigh\Documents\Development\Officejs\sample\app.js:73:3 {
  error: 'Unexpected token u in JSON at position 0',
  authResponse: '',
  intuit_tid: '',
  originalMessage: 'Unexpected token u in JSON at position 0',
  error_description: ''

I modified the sample program to add the OAuthClient.scopes.OpenId, OAuthClient.scopes.Profile, OAuthClient.scopes.Email scopes and added a call to validateIdToken after the createToken call and recreated the error.

I then forced the intuit-oauth version back to 4.0.0 and ran it again and it worked as expected, confirming it is an issue in the new version.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions