Details
-
Question
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
oauth2-1.0.2
-
None
-
None
Description
Hi,
I am using 1.0.2 version of OLTU oAuth client and now the implementation is blocked due to the below issue.
The grand type is password. I think for this grant type redirect URI is not required.
Below is the code for getting the access token in the first attempt.
I have tried with both buildBodyMessage() and buildQueryMessage().
But the error message shows the access token as missing parameter.
Is anything else I need to set in the client request as parameter.
Can you please help me in resolving this issue.
Error Message
invalid_request, Missing parameters: access_token
Stack Trace:
OAuthProblemException{error='invalid_request', description='Missing parameters: access_token', uri='null', state='null', scope='null', redirectUri='null', responseStatus=0, parameters={}}
Java Code
OAuthClientRequest request = OAuthClientRequest.tokenLocation("https://qa.trustamerica.com/liberty/oauth/token")
.setGrantType(GrantType.PASSWORD)
.setClientId("04B13831B0704781BB6FBE6CBD21B014")
.setClientSecret("90CBA686949C4A7582948D0F852D08F2")
.setUsername("apienvestnet")
.setPassword("Integrate17$")
.buildBodyMessage();
OAuthClient oAuthClient = new OAuthClient(new URLConnectionClient());
GitHubTokenResponse oAuthResponse = oAuthClient.accessToken(request, GitHubTokenResponse.class);
Thanks
Sivan