• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
LogIn with Facebook

#1
I am trying to get LogIn with Facebook to work but it isn't getting an Access Token.

I have pinned it down to this function in FacebookRedirectLoginHelper.php



 
Code:
public function getAccessToken($redirectUrl = null)
    {
     
        if (!$code = $this->getCode()) {
            return null;
        }


        $this->validateCsrf();

        $redirectUrl = $redirectUrl ?: $this->urlDetectionHandler->getCurrentUrl();
        // At minimum we need to remove the state param
        $redirectUrl = FacebookUrlManipulator::removeParamsFromUrl($redirectUrl, ['state']);

        return $this->oAuth2Client->getAccessTokenFromCode($code, $redirectUrl);
    }

It is  returning from
Code:
if (!$code = $this->getCode()) {
   return null;
}

with null

The code has me confused - where should getCode get the access code from to start with?


Thanks
Reply

#2
Access Tokens
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply

#3
(07-28-2017, 09:17 AM)InsiteFX Wrote: Access Tokens
I was using the code from https://www.codexworld.com/facebook-login-codeigniter/ and when I traced it through using echos it didn't authenticate as there was no Access Token set. I have no idea why or where it is supposed to get it from. I would have thought there was a  call to facebook but I can't see one
Reply

#4
(07-28-2017, 09:39 AM)Knutsford Wrote:
(07-28-2017, 09:17 AM)InsiteFX Wrote: Access Tokens
I was using the code from https://www.codexworld.com/facebook-login-codeigniter/ and when I traced it through using echos it didn't authenticate as there was no Access Token set. I have no idea why or where it is supposed to get it from. I would have thought there was a  call to facebook but I can't see one

In

FacebookRedirectLoginHelper.php


there is



Code:
 protected function getCode()
    {
        return $this->getInput('code');
    }




and




Code:
 private function getInput($key)
    {
        return isset($_GET[$key]) ? $_GET[$key] : null;
    }



What is suppose to doing the GET to get the value I have no idea. I can't find anything. Does anyone? If not can someone please point me in the direction of something that actually does work please.


Thanks
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.