Fix PKCE Oauth2 exchange#24858
Fix PKCE Oauth2 exchange#24858apparentlymart merged 1 commit intohashicorp:masterfrom mmmorris1975:master
Conversation
Providers like Okta and AWS Cognito expect that the PKCE challenge uses base64 URL Encoding without any padding (base64.RawURLEncoding) Additionally, Okta strictly adheres to section 4.2 of RFC 7636 and requires that the unencoded key for the PKCE data is at least 43 characters in length.
Codecov Report
|
|
Thanks @mmmorris1975! If you update your commit message to include "fixes #24858" that will close the issue automatically when this is merged. |
|
I gave it a quick run against TF Cloud, and all seemed to work as expected. Output show in this gist |
|
Hi @mmmorris1975! Thanks for working on this. We had previously seen this working but I expect that's because previously the challenge had a length that didn't require base64 padding and so it didn't encounter this problem. With that said, this fix looks good to me and I was able to reproduce the testing with Terraform Cloud and with a minimal Amazon Cognito configuration, and so I'm going to merge this. I have not re-verified with Okta because I don't currently have a usable Okta account to test with, but I can see that this change does indeed make Terraform's implementation match the details of the RFC. Thanks again! |
|
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Providers like Okta and AWS Cognito expect that the PKCE challenge
uses base64 URL Encoding without any padding (base64.RawURLEncoding)
Additionally, Okta strictly adheres to section 4.2 of RFC 7636 and
requires that the unencoded key for the PKCE data is at least 43
characters in length.