You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@oltu.apache.org by "Allan Cheong Tyng Huei (JIRA)" <ji...@apache.org> on 2014/06/02 08:00:10 UTC
[jira] [Created] (OLTU-151) URLClientConnection HTTP POST not
encoded in entity body
Allan Cheong Tyng Huei created OLTU-151:
-------------------------------------------
Summary: URLClientConnection HTTP POST not encoded in entity body
Key: OLTU-151
URL: https://issues.apache.org/jira/browse/OLTU-151
Project: Apache Oltu
Issue Type: Bug
Components: oauth2-client
Affects Versions: oauth2-1.0.0
Environment: Windows 7 x64, JDK1.8
Reporter: Allan Cheong Tyng Huei
Code:
final String code = "this-is-an-authorization-code";
OAuthClientRequest request = OAuthClientRequest.tokenProvider(OAuthProviderType.GOOGLE).setClientId(clientId).setClientSecret(secret).setRedirectURI("http://www.example.com/redirect").setCode(code).setGrantType(GrantType.AUTHORIZATION_CODE).buildQueryMessage();
URLConnectionClient urlConnectionClient = new URLConnectionClient();
OAuthResourceResponse response = urlConnectionClient.execute(request, null, HttpMethod.POST, OAuthResourceResponse.class);
Response:
{
"error": "invalid_request",
"error_description": "Required parameter is missing: grant_type"
}
--
This message was sent by Atlassian JIRA
(v6.2#6252)