Azure-Samples / Azure-Samples/ms-identity-ciam-javascript-tutorial

AuthProvider.js breaks on line 130 when Authentication provider is Google

Ouverte
#76 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
PowerShell
Étoiles
75
Forks
65
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

> Please provide us with the following information:
> ---------------------------------------------------------------

### This issue is for a: (mark with an `x`)
```
- [ x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
> Add Google as an external authentication provider, add it to the user flow and use it to authenticate

### Any log messages given by the failure
>
\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\auth\AuthProvider.js:130
codeVerifier: req.session.pkceCodes.verifier, // PKCE Code Verifier
^

TypeError: Cannot read properties of undefined (reading 'verifier')
at AuthProvider.handleRedirect (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\auth\AuthProvider.js:130:49)
at exports.handleRedirect (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\controller\authController.js:8:25)
at Layer.handle [as handle_request] (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\layer.js:95:5)
at next (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\route.js:144:13)
at Route.dispatch (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\route.js:114:3)
at Layer.handle [as handle_request] (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\layer.js:95:5)
at C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\index.js:284:15
at Function.process_params (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\index.js:346:12)
at next (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\index.js:280:10)
at Function.handle (C:\GitHub\ms-identity-ciam-javascript-tutorial\2-Authorization\4-call-api-express\App\node_modules\express\lib\router\index.js:175:3)

### Expected/desired behavior
> Not to crash

### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

### Versions
> Windows 11

### Mention any other details that might be useful
I changed the line to "codeVerifier: req.session.pkceCodes.verifier || 'Not verified', // PKCE Code Verifier" just to be able to continue with Entra External ID testing.
> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.