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

code_challenge is empty #216

Closed
rgunczer opened this issue Sep 17, 2019 · 3 comments · Fixed by #221
Closed

code_challenge is empty #216

rgunczer opened this issue Sep 17, 2019 · 3 comments · Fixed by #221

Comments

@rgunczer
Copy link

rgunczer commented Sep 17, 2019

During Login Redirect the generated url contains a code_challange query parameter with empty value.

https://auth.brucke.club/login?state=g6Fo2SBGaHVTN196OGlVdFltNDVLQTZZRzFHT1Q1RTF1elBZZKN0aWTZIDVFbmJadWxiOHBNdDhCSkRxOHlCT2RLSGk5MWRDdTlzo2NpZNkgd0xTSVA0N3dNMzl3S2REbU9qNlpiNWVTRXczSlZoVnA&client=wLSIP47wM39wKdDmOj6Zb5eSEw3JVhVp&protocol=oauth2&scope=openid%20profile%20email&response_type=code&response_mode=query&nonce=.FS1wxtuxKVMDZ0S8f3~aZN3Hka48tP3V0qjoKYJjU3&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F&code_challenge=&code_challenge_method=S256&auth0Client=eyJuYW1lIjoiYXV0aDAtc3BhLWpzIiwidmVyc2lvbiI6IjEuMi4zIn0%3D

File: Auth0Client.ts
Line: 207

const code_challenge = bufferToBase64UrlEncoded(code_challengeBuffer);

After looking a bit closer. This line

const code_challengeBuffer = await sha256(code_verifier);

const code_challengeBuffer = await sha256(code_verifier);
Fills the code_challengeBuffer however that value is lost in the next line:
const code_challenge = bufferToBase64UrlEncoded(code_challengeBuffer);

Going into bufferToBase64UrlEncoded function in this line

const ie11SafeInput = new Uint8Array(Array.from(input));

the content is lost.

Hope this helps.

@benprime
Copy link
Contributor

Having the same problem.

@benprime
Copy link
Contributor

@rgunczer I was able to get it to send the code challenge by rolling the library version back to 1.0.1
npm install --save @auth0/[email protected]

@benprime benprime mentioned this issue Sep 20, 2019
4 tasks
@rgunczer
Copy link
Author

@benprime Thanks, it woks with the older version and waiting for your fix to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants