-
Notifications
You must be signed in to change notification settings - Fork 42
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
Gracefully handle redirect for DPoP #493
Merged
Merged
Commits on Oct 30, 2020
-
DPoP-authenticated fetch manages redirection
Since a DPoP header is scoped to one target IRI, if the request is redirected, the DPoP header is invalid, which results in a 401 unauthenticated. To fix the issue, the fetch must capture the redirection, and replay the request to the actual target IRI.
Configuration menu - View commit details
-
Copy full SHA for 052b627 - Browse repository at this point
Copy the full SHA 052b627View commit details -
Checks response's URL to detect redirect
Tests showed that e.g. a 303 did not set response.redirected to true. In order for the redirection detection to be successful, the response's URl is compared to the original fetch parameter.
Configuration menu - View commit details
-
Copy full SHA for 13a5bf6 - Browse repository at this point
Copy the full SHA 13a5bf6View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4fecad - Browse repository at this point
Copy the full SHA c4fecadView commit details -
In order to avoid to issue an additional request in case a redirect leads to an error, the redirections are handled manually, and not internally by the browser. This means that each individual request has an appropriate DPoP header, matching the actual target resource.
Configuration menu - View commit details
-
Copy full SHA for 92ee19c - Browse repository at this point
Copy the full SHA 92ee19cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1019104 - Browse repository at this point
Copy the full SHA 1019104View commit details -
Fetching with 'redirect: manual' doesn't allow to get the target IRI, which prevents from succesfully redirecting. This rolls back to the previous approach, but prevents from replaying a request if a non-auth error is reported.
Configuration menu - View commit details
-
Copy full SHA for 85a870a - Browse repository at this point
Copy the full SHA 85a870aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 40a6464 - Browse repository at this point
Copy the full SHA 40a6464View commit details -
Configuration menu - View commit details
-
Copy full SHA for a22a607 - Browse repository at this point
Copy the full SHA a22a607View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ed5a4a - Browse repository at this point
Copy the full SHA 2ed5a4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4080b26 - Browse repository at this point
Copy the full SHA 4080b26View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.