Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Inject Multimap with POST params through an HttpServletRequestWrapper #33

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

berezovskyi
Copy link
Contributor

Depending on the configuration of the JAX-RS application, especially under Jersey, POST parameters may not be readable from the HttpServletRequest and shall be accessed through JAX-RS facilities instead. See https://stackoverflow.com/questions/22376810/unable-to-retrieve-post-data-using-context-httpservletrequest-when-passed-to-o for more details.

While I defined a new interface IJaxTokenStrategy that does not depend on the HttpServletRequest, the key method net.oauth.server.HttpRequestMessage#getParameters does and is outside of our control. Therefore, OAuthRequest.OAuthServletRequestWrapper class has been defined to wrap the original request while substituting the parameter map.

Given that OAuthRequest already provides a reference to the HttpServletRequest, I decided not to remove the newly created interface.

@berezovskyi
Copy link
Contributor Author

@jadelkhoury this PR will be a bit hard to migrate to https://github.com/eclipse/lyo

Should we merge this one? did you have a chance to test it? I think I wrote the code in response to OAuth failing when POST requests are used. I don't recall the exact problem. Did you ever hit something similar?

@berezovskyi
Copy link
Contributor Author

Hmm, apparently this PR is superseded by #36?

@jad I don't recall how to reproduce this but I am pretty sure it happened almost out of the box with the Jersey instead of Wink. Did you implement OAuth without Wink and really never hit this problem?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant