You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 5, 2022. It is now read-only.
spring-social-twitter post tweet failed with dependency spring 5.1.5.RELEASE
Actual Behavior
The exception stack is following.
Could not authenticate you.
org.springframework.social.MissingAuthorizationException: Authorization is required for the operation, but the API binding was created without authorization.
at org.springframework.social.twitter.api.impl.TwitterErrorHandler.handleClientErrors(TwitterErrorHandler.java:100)
at org.springframework.social.twitter.api.impl.TwitterErrorHandler.handleError(TwitterErrorHandler.java:60)
at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:778)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:736)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:710)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:436)
at org.springframework.social.twitter.api.impl.TimelineTemplate.updateStatus(TimelineTemplate.java:198)
at org.springframework.social.twitter.api.impl.TimelineTemplate.updateStatus(TimelineTemplate.java:160)
at cn.nextop.erebor.batch.job.social.twitter.AbstractTwitterTasklet.post(AbstractTwitterTasklet.java:21)
at cn.nextop.erebor.batch.job.social.twitter.TwitterIndicatorTasklet.issue(TwitterIndicatorTasklet.java:167)
at cn.nextop.erebor.batch.job.social.twitter.TwitterIndicatorTasklet.doExecute(TwitterIndicatorTasklet.java:114)
at cn.nextop.erebor.core.batch.domain.spring.BatchTasklet.execute(BatchTasklet.java:206)
at org.springframework.batch.core.step.tasklet.TaskletStepChunkTransactionCallback.doInTransaction(TaskletStep.java:407)
at org.springframework.batch.core.step.tasklet.TaskletStepChunkTransactionCallback.doInTransaction(TaskletStep.java:331)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
at org.springframework.batch.core.step.tasklet.TaskletStep2.doInChunkContext(TaskletStep.java:273)
at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:203)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.AbstractJob.handleStep(AbstractJob.java:399)
at org.springframework.batch.core.job.SimpleJob.doExecute(SimpleJob.java:135)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:313)
at org.springframework.batch.core.launch.support.SimpleJobLauncher1.run(SimpleJobLauncher.java:144)
at java.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at cn.nextop.erebor.common.util.concurrent.future.impl.XRunnableFuture.run(XRunnableFuture.java:62)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutorWorker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Expected Behavior
no exception stack and tweet success.
Configuration
NOP
Version
from spring-social-core-1.1.0.RELEASE to recent version
spring version: 5.1.5.RELEASE
Sample
final String key = "key";
final String token ="token";
final String secret1 = "secret1";
final String secret2 = "secret2";
final TwitterTemplate t = new TwitterTemplate(key, secret1, token, secret2);
t.timelineOperations().updateStatus("some content");
The root cause is in org.springframework.social.oauth1.SigningSupport line 191
if (bodyType != null && bodyType.equals(MediaType.APPLICATION_FORM_URLENCODED))
Summary
spring-social-twitter post tweet failed with dependency spring 5.1.5.RELEASE
Actual Behavior
The exception stack is following.
Expected Behavior
no exception stack and tweet success.
Configuration
NOP
Version
from spring-social-core-1.1.0.RELEASE to recent version
spring version: 5.1.5.RELEASE
Sample
The root cause is in
org.springframework.social.oauth1.SigningSupport
line 191but int spring 5.1.5.RELEASE the default content-type change to application/x-www-form-urlencoded;charset:UTF-8
so sign the wrong signature.
workaround with spring 5.1.5.RELEASE
The text was updated successfully, but these errors were encountered: