> The browser gets a token back that makes perfect sense and the example is 
> completed.
> How do I "consume" the token?  I'll play around with it a bit and let you 
> know what
> I come up with.  Thanks for the help.

Based on the path I was taking, the redirect URI is the key.  Facebook 
redirects as such:

YOUR_REDIRECT_URI?
    access_token=USER_ACCESS_TOKEN
   &expires_in=NUMBER_OF_SECONDS_UNTIL_TOKEN_EXPIRES
   &state=YOUR_STATE_VALUE

Of course, if the request fails authentication, they redirect as follows:

YOUR_REDIRECT_URI?
    error_reason=user_denied
   &error=access_denied
   &error_description=The+user+denied+your+request.
   &state=YOUR_STATE_VALUE

So your redirect page could start out like this:

public class FacebookResponseListener extends WebPage {

        private static final long serialVersionUID = 1L;
        
        public FacebookResponseListener(PageParameters params) {
                // if there is an error, handle it
                if (params.get("error_reason") != null) {
                        // handle the error here!
                } else {
                        String accessToken = 
params.get("access_token").toString();
                        int expiresIn = params.get("expires_in").toInt();
                        
                        // etc... etc...
                        
                }
                
        }
}

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to