bdunn44 / vaadin-oauthpopup

OAuth Popup Add-on for Vaadin 7.1+
Apache License 2.0
5 stars 10 forks source link

Example of Facebook sign in #4

Closed EightRice closed 7 years ago

EightRice commented 7 years ago

Does anyone have a working example of how to sign in with Facebook using this addon?

bdunn44 commented 7 years ago

Check here: https://github.com/bdunn44/Vaadin-Addon-Demo

bdunn44 commented 7 years ago

..more specifically: https://github.com/bdunn44/vaadin-oauthpopup/tree/master/oauthpopup-demo/src/main/java/org/vaadin/addon/oauthpopup/demo

EightRice commented 7 years ago

There is no Facebook button in these links, bdunn44. I think my question was clear enough.

bdunn44 commented 7 years ago

Dude, it's easy. You can use literally any OAuth API that Scribe supports - read the readme for the project (https://github.com/bdunn44/vaadin-oauthpopup).

The example in the readme:

OAuthPopupButton twitter = new OAuthPopupButton(
                com.github.scribejava.apis.TwitterApi.instance(), "my-key", "my-secret");

...can be modified for Facebook by changing the first argument of the constructor:

OAuthPopupButton fb = new OAuthPopupButton(
                com.github.scribejava.apis.FacebookApi.instance(), "my-key", "my-secret");

Check the demo source code (and the readme!) for other ways to configure the OAuth authorization process.

You also commented on an old commit that you weren't able to resolve the Scribe import... This is also described in the readme, you may need to add the dependency manually:

<dependency>
   <groupId>com.github.scribejava</groupId>
   <artifactId>scribejava-apis</artifactId>
   <version>2.7.3</version>
</dependency>

It seems like you're pretty new to Java... Happy to help, but drop the attitude!

EightRice commented 7 years ago

Thanks! Attitude dropped.