[AIRFLOW-2185] Use state instead of query param for redirect_uri#3103
[AIRFLOW-2185] Use state instead of query param for redirect_uri#3103samschlegel wants to merge 1 commit intoapache:masterfrom
Conversation
445ec9e to
26122d2
Compare
Change copied from apache#3103
|
@samschlegel Would there be any way to test this? |
|
Please rebase onto master to fix the CI |
Both the Google OAuth2 and GHE authentication plugins include the `next_url` as a query parameter in redirect_uri. This breaks at least Google OAuth2, unless you include the query parameter in the authorized redirection URI. This isn't the most flexible solution, as you would have to do the same for every potential next URL, and seems to go against the OAuth2 spec. Instead the next_url should be sent via the state parameter which MUST be maintained by all spec compliant OAuth2 implementations, and is not used when comparing redirection URIs.
26122d2 to
a7de7de
Compare
|
Could use But if you wanted to actually test with Google OAuth2, that's a much more involved process that would probably require a headless browser and a GCP account. I'm not sure what the process would be with GHE, but given you need a license to run it I'm not sure it would be much easier. Could testing this be added as a separate Jira ticket since it's non-trivial? |
|
It 100% works with GCP for us, but since I can't test with GHE I can remove that part of the change, unless someone else can test it. |
Codecov Report
@@ Coverage Diff @@
## master #3103 +/- ##
=======================================
Coverage 73.07% 73.07%
=======================================
Files 180 180
Lines 12578 12578
=======================================
Hits 9191 9191
Misses 3387 3387Continue to review full report at Codecov.
|
|
Would love for this to be merged. @Fokko are you blocking this on testing? |
Both the Google OAuth2 and GHE authentication plugins include the `next_url` as a query parameter in redirect_uri. This breaks at least Google OAuth2, unless you include the query parameter in the authorized redirection URI. This isn't the most flexible solution, as you would have to do the same for every potential next URL, and seems to go against the OAuth2 spec. Instead the next_url should be sent via the state parameter which MUST be maintained by all spec compliant OAuth2 implementations, and is not used when comparing redirection URIs. Closes apache#3103 from samschlegel/AIRFLOW-2185
Both the Google OAuth2 and GHE authentication plugins include the `next_url` as a query parameter in redirect_uri. This breaks at least Google OAuth2, unless you include the query parameter in the authorized redirection URI. This isn't the most flexible solution, as you would have to do the same for every potential next URL, and seems to go against the OAuth2 spec. Instead the next_url should be sent via the state parameter which MUST be maintained by all spec compliant OAuth2 implementations, and is not used when comparing redirection URIs. Closes apache#3103 from samschlegel/AIRFLOW-2185
Both the Google OAuth2 and GHE authentication plugins include the `next_url` as a query parameter in redirect_uri. This breaks at least Google OAuth2, unless you include the query parameter in the authorized redirection URI. This isn't the most flexible solution, as you would have to do the same for every potential next URL, and seems to go against the OAuth2 spec. Instead the next_url should be sent via the state parameter which MUST be maintained by all spec compliant OAuth2 implementations, and is not used when comparing redirection URIs. Closes apache#3103 from samschlegel/AIRFLOW-2185
JIRA
Description
Both the Google OAuth2 and GHE authentication plugins include the
next_urlas a query parameter in redirect_uri. This breaks at least Google OAuth2, unless you include the query parameter in the authorized redirection URI. This isn't the most flexible solution, as you would have to do the same for every potential next URL, and seems to go against the OAuth2 spec.Instead the next_url should be sent via the state parameter which MUST be maintained by all spec compliant OAuth2 implementations, and is not used when comparing redirection URIs.
Tests
This is not easily unit testable, but I have tested it with Google OAuth2. Assuming GHE follows the OAuth2 spec, it should work there as well.
Commits
My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
Passes
git diff upstream/master -u -- "*.py" | flake8 --diff