401:Authentication credentials ... Error processing your OAuth request: Invalid oauth_verifier paramete


#1

I tried to use oauth api getOAuthAccessToken via twitter4j. In case of my local test , I got a access token successfully. I cannot find a solution for my situation.

Below log is my stack trace information

my exception code is “exceptionCode=[1aec76dd-78d46647]”.


401:Authentication credentials (https://dev.twitter.com/pages/auth) were missing or incorrect. Ensure that you have set valid consumer key/secret, access token/secret, and the system clock is in sync.
Error processing your OAuth request: Invalid oauth_verifier parameter

Relevant discussions can be found on the Internet at:
http://www.google.co.jp/search?q=1aec76dd or
http://www.google.co.jp/search?q=78d46647
TwitterException{exceptionCode=[1aec76dd-78d46647], statusCode=401, message=null, code=-1, retryAfter=-1, rateLimitStatus=null, version=4.0.7}
at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:170)
at twitter4j.HttpClientBase.request(HttpClientBase.java:57)
at twitter4j.HttpClientBase.post(HttpClientBase.java:86)
at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:132)
at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:146)
at twitter4j.TwitterBaseImpl.getOAuthAccessToken(TwitterBaseImpl.java:366)
at co.benx.community.front.controller.HubController.twitterLoginGate(HubController.java:1306)
at sun.reflect.GeneratedMethodAccessor526.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:877)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:783)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925)


#2

Hello @weverseofficial - I’m not too familiar with that tool, but you are going to need to make sure that the final request is passing through the consumer key and secret from your app, the access token and access token secret from the user you are making a request on behalf of, and a nonce, timestamp and signature. You can read more about this in our documentation:

https://developer.twitter.com/en/docs/basics/authentication/overview/oauth
https://developer.twitter.com/en/docs/basics/authentication/guides/creating-a-signature