oauth

Hi community,

is there an example of how to integrate an oauth authentication with vaadin, not the GAE Google auth, but services like OpenID, I found a JSP example at

Google Code
, but I have no plan to transform this into my vaadin app :frowning:

Anybody out there, who could help?

regards
Meex

Hi,

I Know this is late but incase if someone wants to know about vaadin oauth client application please read the following:

Details:
Using Scribe library for OAuth.
Using Sample provided at https://github.com/fernandezpablo85/scribe-java.

Attached Vaadin client application to access private data from Twitter.

Steps:

  • Goto https://dev.twitter.com/apps
  • Login & select create a new application
  • Provide neccessary details:

    WebSite
    : your vaadin client application url

    Callback
    URL: you can give the same vaadin client url (it is the url with which ‘oauth_verifier’ is returned )
    etc.,
  • Get the Consumer key & secret provided by the twitter.
  • Go to org.example.oauthtest.TwitterOauth and replace the key & secret of ServiceBuilder & also the
    Callback
    .
  • Now deploy your application with the url you specified in twitter’s ’
    WebSite
    ’ option.
  • Click the connect button. it will take you to the twitter authorization page.
  • Give the username & password and say authorize app. It will take you back to your application using callback url.
  • That’s it you can find the retrived data in the TextArea.

NOTE: Please bear with the application code if its not upto the standards.

Regards,
Rajan.M
12035.zip (3.64 KB)
12036.jar (56.3 KB)
12037.jar (71.4 KB)

FYI, there is now a Vaadin add-on called
OAuth Buttons
providing pre-programmed buttons to “Log in with Facebook”, “Log in with Twitter”, and “Log in with LinkedIn” using the Scribe library and OAuth protocol.

‘OAuth Buttons’ is a nice library but it wasn’t compatible with Vaadin 7. I made a compatible version by changing a few lines in OAuthButton.java, everything else is untouched:


http://pastebin.com/tSZhV8U6

The only thing to remember is to have the main UI preserve on refresh, otherwise it overrides everything once the callback url is called from twitter:

@PreserveOnRefresh
public class TestPage extends UI implements OAuthListener{

Follow up to the last post from Abbas. So when the callback url is called and with "PreserveOnRefresh on and you get to the exactly the point you left your UI, how do you pick up the access token and proceed without new user action (i.e. pressing a button or anything else)?
So what is the suggested flow after the callback provides the access token?