[
https://issues.apache.org/jira/browse/HTTPCLIENT-1192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13283701#comment-13283701 ]
Jacob L E Blain Christen edited comment on HTTPCLIENT-1192 at 5/25/12 7:36 PM:
-------------------------------------------------------------------------------
Snippets to demonstrate the problem:
/* works correctly: notice how the redirect_uri value is encoded properly */
URI.create("
https://some.awesome-service.com/oauth/token"
+ "?client_id=" + URLEncoder.encode("1234567890","UTF-8")
+ "&client_secret=" + URLEncoder.encode("abcdefghijklmnopqrstuvwxyz","UTF-8")
+ "&code=" + URLEncoder.encode("kjhbdafoiuhw9p78hfibsdklvjbnkjsldvkljncdkjnsadklvjnsalkjdfn","UTF-8")
+ "&redirect_uri=" + URLEncoder.encode("
https://localhost/oauth_callback","UTF-8")
).toString()
//
https://some.awesome-service.com/oauth/token?client_id=1234567890&client_secret=abcdefghijklmnopqrstuvwxyz&code=kjhbdafoiuhw9p78hfibsdklvjbnkjsldvkljncdkjnsadklvjnsalkjdfn&redirect_uri=https%3A%2F%2Flocalhost%2Foauth_callback/* works incorrectly: notice how the redirect_uri value is encoded twice (eg %2F becomes %252F) */
new URIBuilder("
https://some.awesome-service.com/oauth/token")
.addParameter("client_id","1234567890")
.addParameter("client_secret","abcdefghijklmnopqrstuvwxyz")
.addParameter("code","kjhbdafoiuhw9p78hfibsdklvjbnkjsldvkljncdkjnsadklvjnsalkjdfn")
.addParameter("redirect_uri","
https://localhost/oauth_callback")
.build().toString()
//
https://some.awesome-service.com/oauth/token?client_id=1234567890&client_secret=abcdefghijklmnopqrstuvwxyz&code=kjhbdafoiuhw9p78hfibsdklvjbnkjsldvkljncdkjnsadklvjnsalkjdfn&redirect_uri=https%253A%252F%252Flocalhost%252Foauth_callback
was (Author: dweomer):
Snippets to demonstrate the problem:
/* works correctly: notice how the redirect_uri value is encoded properly */
URI.create("
https://some.awesome-service.com/oauth/token"
+ "?client_id=" + URLEncoder.encode("1234567890","UTF-8")
+ "&client_secret=" + URLEncoder.encode("abcdefghijklmnopqrstuvwxyz","UTF-8")
+ "&code=" + URLEncoder.encode("kjhbdafoiuhw9p78hfibsdklvjbnkjsldvkljncdkjnsadklvjnsalkjdfn","UTF-8")
+ "&redirect_uri=" + URLEncoder.encode("
https://localhost/oauth_callback","UTF-8")
).toString()
/* works incorrectly: notice how the redirect_uri value is encoded twice (eg %2F becomes %252F) */
new URIBuilder("
https://some.awesome-service.com/oauth/token")
.addParameter("client_id","1234567890")
.addParameter("client_secret","abcdefghijklmnopqrstuvwxyz")
.addParameter("code","kjhbdafoiuhw9p78hfibsdklvjbnkjsldvkljncdkjnsadklvjnsalkjdfn")
.addParameter("redirect_uri","
https://localhost/oauth_callback")
.build().toString()
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspaFor more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail:
dev-unsubscribe@...
For additional commands, e-mail:
dev-help@...