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

supportPKCE return value is incorrect #710

Closed
2 tasks done
mo36924 opened this issue Oct 18, 2024 · 2 comments
Closed
2 tasks done

supportPKCE return value is incorrect #710

mo36924 opened this issue Oct 18, 2024 · 2 comments
Labels

Comments

@mo36924
Copy link

mo36924 commented Oct 18, 2024

What happened?

supportsPKCE return value is incorrect.

openid-client/src/index.ts

Lines 1464 to 1472 in ff1436e

supportsPKCE: {
__proto__: null,
value(method = 'S256') {
return (
metadata.code_challenge_methods_supported?.includes(method) !== true
)
},
},
}

The following code may be more correct.

metadata.code_challenge_methods_supported?.includes(method) === true 

Version

v6.1.0

Runtime

Node.js

Runtime Details

v20.17.0

Code to reproduce

import { equal } from "node:assert";
import { discovery } from "openid-client";

const config = await discovery(new URL("https://accounts.google.com"), "clientId", "clientSecret");
equal(config.serverMetadata().code_challenge_methods_supported?.includes("S256"), true);
// The following line throws an error
equal(config.serverMetadata().supportsPKCE(), true);

Required

  • I have searched the issues tracker and discussions for similar topics and couldn't find anything related.
  • I agree to follow this project's Code of Conduct
@mo36924 mo36924 added the triage label Oct 18, 2024
@mo36924 mo36924 changed the title supportPKCE return value is incorrect. supportPKCE return value is incorrect Oct 18, 2024
@panva
Copy link
Owner

panva commented Oct 18, 2024

Damn you're right, i took the code from my previous examples that was checking for anything but true.

panva added a commit that referenced this issue Oct 18, 2024
@panva
Copy link
Owner

panva commented Oct 18, 2024

Fixed in https://github.com/panva/openid-client/releases/tag/v6.1.1

@panva panva added bug and removed triage labels Oct 18, 2024
@panva panva closed this as completed Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants