Quantcast
Channel: Spring Community Forums - Social
Viewing all articles
Browse latest Browse all 145

Facebook access token authorization failure

$
0
0
I'm trying to create a simple connection to Facebook using the access token generated by Facebook's Access Token Tool, however I'm getting a MissingAuthorizationException when I attempt to create the connection.

Here's the code:
Code:

FacebookConnectionFactory factory = new FacebookConnectionFactory( <appId>, <appSecret>, <appNamespace> );
           
AccessGrant accessGrant = new AccessGrant( <accessToken> );
           
Connection<Facebook> connection = factory.createConnection( accessGrant );
           
Facebook facebook = connection.getApi();
           
facebook.feedOperations().updateStatus( "test" );

Here is the exception message:
Code:

GET request for "https://graph.facebook.com/me" resulted in 400 (Bad Request); invoking error handler
org.springframework.social.MissingAuthorizationException: Authorization is required for the operation, but the API binding was created without authorization.

Any help pointing me in the direction of what's missing would be greatly appreciated.

Viewing all articles
Browse latest Browse all 145

Trending Articles