visual c++ - IWebBrowser2 facebook login -
i'm working on windows based application in c++ requires facebook login. i'm using using ole embedding/activex control clsid_webbrowser component (iwebbrowser2) authentication.
this works pretty in far create window, embed activex web browser control, , direct facebook login 'authorization url', such as...
xxx set our app id.
this works, , can login. problem if quit , restart app, if i've selected 'keep me logged in' in web page, have retype in password.
i generally, because if don't use facebook auth url above, , go www.facebook.com, within active x control , log in - remember i'm logged in, , don't have type in password if shutdown , restart app.
as side detail of separate behavior of running ie. if run ie , login - has no effect on login inside of app. , it's not unique implementation of activex control embedding. if run juce library demo - has web browser active x component, has same behavior mine. is...
1) can login via https://graph.facebook.com/oauth/authorize - if restart demo, won't remember previous login 2) if login via www.facebook.com remember i've logged in + login in juce allow me login without password app 3) login ie has no effect
it's tedious have login every time, , seems incorrect behavior have if select 'remain logged in'. not appear it's problem activex control saving session state - session state maintained when use www.facebook.com login. may worth saying - can't use www.facebook.com login, because doesn't return information app requires work, that's authorize style url about.
the implication seems facebook doing different in these scenarios - it's not storing login information if use authorization url.
so question how fix problem - such 'remain logged in' remain logged application authentication through authorization url?
i guess work around, store authorization token in app, , try , see token valid @ startup perhaps. i'm not sure that's 'right' way it. note - original implementation used ole automation (effectively app controlled separate ie process), , had none of these problems. unfortunately ie 11, ole automation seems have been broken.
thank time , wisdom.
i didn't find away honor 'keep me logged in' within facebook. instead, if user logs in store authorization token encrypted in file. if restart application, attempt login using stored auth token. if fails, standard login sequence pursed. equivalent acting if 'keep me logged in' set, isn't right, better usability point of view opposite.
it may potentially possible lookup 'keep me logged in' element dom of webpage, , see set to. seems kinda fragile.
i remain open suggestions on, how 'do properly'.
Comments
Post a Comment