kong icon indicating copy to clipboard operation
kong copied to clipboard

fix(oauth2): specify correct client type in `code_challenge` error msg

Open onematchfox opened this issue 2 years ago • 0 comments

Summary

PKCE enforcement can be applied to both public and confidential clients as per the implementation of requires_pkce. Currently the error returns to calling applications will always specify that code_challenge is required for **public** clients (even if the calling client is a confidential client). This PR ensures that the error message correctly reflects the client type.

Full changelog

  • Use client.client_type when building "code challenge required" error message to ensure that the error message correctly reflects the calling client's type
  • Updated existing test for confidential client to reflect the updated error message.

Issue reference

onematchfox avatar Jun 13 '22 19:06 onematchfox