Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>//using a javascript for popup for facebook login</p> <pre><code>FB.login(function(response) { if (response.authResponse) { var accessToken = response.authResponse.accessToken; </code></pre> <p>//got the accesstoken with 1-2 hours expire time</p> <p>//got the accesstoken into a controller called facebook controller</p> <pre><code> $request = $this-&gt;getRequest(); $params = $request-&gt;getParams(); $token=$params['accessToken']; </code></pre> <p>//taking the access token to extend to 60days</p> <pre><code> $conf = $this-&gt;getConfigs(); $appid = $conf['fbdetails']['appid']; $secret = $conf['fbdetails']['secret']; $baseurl = $conf['app']['baseurl']; </code></pre> <p>//After the execution of below code , we will have a response with acess token expire time to 60days.</p> <pre><code> $token_url = "https://graph.facebook.com/oauth/access_token?client_id=".$appid."&amp;client_secret=".$secret."&amp;grant_type=fb_exchange_token&amp;fb_exchange_token=".$token; </code></pre> <p>// Above response is given for parsing. </p> <pre><code> $c = curl_init(); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); curl_setopt($c, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($c, CURLOPT_URL, $token_url); $contents = curl_exec($c); $err = curl_getinfo($c,CURLINFO_HTTP_CODE); curl_close($c); $paramsfb = null; parse_str($contents, $paramsfb); </code></pre> <p>//after the parsing the contents in the above execution code the new extended accesstoken is stored.</p> <pre><code> $user_session = new Zend_Session_Namespace('fbuser'); $user_session-&gt;access_token = $paramsfb['access_token']; </code></pre> <p>//stored to session.</p> <pre><code> $this-&gt;_redirect('/home'); </code></pre> <p>//Have a nice coding</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload