connect/twitter POST not redirecting to twitter authorisation

656 views Asked by At

I have created my app on Twitter and now I want to user Spring-Social to manage user authorisations.

I follwed this basic tutorial accessing twitter. The REST Server starts up fine, I navigate to host:8080/connect/twitter the default view is rendered. The problem is that when I click the "connect" button I am redirectd back to the connect view and not to twitter.

I ran a POST through fiddler and I get a 302 Location: http://localhost:8080/connect/twitter;jsessionid=XXXXXXX

My application.properties has spring.social.twitter.appId=MY_VALID_ID spring.social.twitter.appSecret=MY_VAID_SECRET spring.social.auto_connection_views=true

I would expect to be redirected to twitter for authorisation at this point?

3

There are 3 answers

5
Ntobeko Mkhize On BEST ANSWER

foolishly I had not included a value to the "Callback URL" when registering my app on Twitter. After adding a place-holder URL it is now working fine.

And as to be expected the actual callback URL used is the value submitted as "applicationURL". Thanks, I hope this help someone else.

0
Ruby Kannan On

Change the url for authorization from

 /connect/twitter 

to

 /auth/twitter

Hope the security filter will listen your request.

0
Craig Walls On

It's hard to say for sure with the information you've given, but the most obvious thing I'd do next is compare what you've done with the "complete" code at https://github.com/spring-guides/gs-accessing-twitter/tree/master/complete. I just now checked out a clean copy of that, plugged in my app's credentials and tried it. It worked as expected.

When you POST through fiddler, where's that 302 coming from? Is it Twitter giving it? Or is it the app itself giving the 302?