Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Undefined "token_type" #317

Closed
Closed
@tomdean

Description

I've started suddenly getting an error during the OAuth2 process after the user has been redirected back.

Strategy: OIDC
Response Type: "id_token code"
Response Mode: form_post

Versions:
passport-azure-ad@3.0.6
oauth@0.9.14

if (items.token_type.toLowerCase() !== 'bearer') {
                      ^
TypeError: Cannot read property 'toLowerCase' of undefined
	at self._getAccessTokenBySecretOrAssertion (/node_modules/passport-azure-ad/lib/oidcstrategy.js:1151:25)
	at oauth2._request (/node_modules/passport-azure-ad/lib/oidcstrategy.js:1395:7)
	at passBackControl (/node_modules/oauth/lib/oauth2.js:125:9)
	at IncomingMessage.<anonymous> (/node_modules/oauth/lib/oauth2.js:143:7)
	at emitNone (events.js:110:20)
	at IncomingMessage.emit (events.js:207:7)
	at endReadableNT (_stream_readable.js:1047:12)
	at _combinedTickCallback (internal/process/next_tick.js:102:11)
	at process._tickDomainCallback (internal/process/next_tick.js:198:9)

The items object does not have a token_type property - the only key present is id_token.

Stopped suddenly working without any changes/pushes (app was running fine yesterday, not so fine today). Could Microsoft/Azure changed something on their end?

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions