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

Detect Lyo URI and correctly pass POST parameters#36

Open
berezovskyi wants to merge 5 commits intomasterfrom
detecturi
Open

Detect Lyo URI and correctly pass POST parameters#36
berezovskyi wants to merge 5 commits intomasterfrom
detecturi

Conversation

@berezovskyi
Copy link
Contributor

This PR fixes two issues:

  • supplying the Lyo base URI in the OAuth request context (see OAuthRequest(HttpServletRequest request, boolean detectLyoURI))
  • properly passing POST parameters to the OAuth internals (see OAuthRequest.OAuthServletRequestWrapper class and OAuthService::doPostRequestToken where its intended use is shown)

This is a pretty major change and I am surprised how it worked before. Apparently, Wink had some extra behaviour that allowed for the input stream to be read multiple times.

@berezovskyi berezovskyi added this to the 4.0.0 milestone Dec 10, 2019
@jadelkhoury
Copy link
Contributor

I don't believe we have migrated lyo.server to Jax-rs 2.0. So maybe it's about time.
But as usual, with such large pull requests, I'd be happy to do a live review.

@berezovskyi
Copy link
Contributor Author

@jadelkhoury
Copy link
Contributor

I take it back then :-)

}
}

public static class OAuthServletRequestWrapper extends HttpServletRequestWrapper {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment why to do this

If the parameter data was sent in the request body, such as occurs with an HTTP POST request, then reading the body directly via getInputStream() or getReader() can interfere with the execution of this method.

https://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getParameter(java.lang.String)

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.

2 participants