I got this figure out. I'll post my solution tomorrow when I have a few minutes.
Basically, I wasn't understanding that the code was coming back in a page parameter. Once I understood that it was fairly easy to implement. On Monday, February 18, 2013, Stephen Walsh wrote: > That's where I'm headed right now. I had a signin page with > PageParameters that picked it up by accident... I think I'm headed in the > right direction now. > > I'll post my solution when I get it finished. I'd still be interested to > see your solution also. > > Thanks again. > > _______________________________________ > Stephen Walsh | http://connectwithawalsh.com > > > On Mon, Feb 18, 2013 at 6:29 PM, Michael Chandler < > [email protected] <javascript:_e({}, 'cvml', > '[email protected]');>> wrote: > >> > 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]<javascript:_e({}, 'cvml', >> '[email protected]');> >> For additional commands, e-mail: >> [email protected]<javascript:_e({}, 'cvml', >> '[email protected]');> >> >> > -- _______________________________________ Stephen Walsh | http://connectwithawalsh.com
