Friday, March 25, 2016

Redirect to Facebook page using scribe

Leave a Comment

I want to create Facebook icon in JSF page. I tested examples from official Facebook but when integrate it I need to also import JavaScript library. As a result it's loading very slow.

Is there a way to use scribe for example to generate Facebook page link? I tested this:

<h:commandButton value="Generate" action="#{index.facebookRedirect()}"></h:commandButton>   public String facebookRedirect()     {         Token NULL_TOKEN = null;          OAuthService service = new ServiceBuilder()             .provider(FacebookApi.class)             .apiKey("key").apiSecret("1187326234618591")             .scope("email").callback("https://hostname/endpoint/")             .build();              String redirectUrl = service.getAuthorizationUrl(NULL_TOKEN);              return redirectUrl;      } 

But I get java.lang.IllegalArgumentException: Must provide a valid string as verifier

Is there any better solution?

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment