Loading...
 
Features / Usability

Features / Usability


Re: Social Login unable to auto create user

posts: 68 United Kingdom
Copy to clipboard
function getFacebookAccessToken() { global $prefs, $user; $userlib = TikiLib::lib('user'); // code parameter provided by Facebook is already in the url $url = '/' . $this->graphVersion . '/oauth/access_token?client_id=' . $prefs['socialnetworks_facebook_application_id'] . '&redirect_uri=' . $this->getURL() . '&client_secret=' . $prefs['socialnetworks_facebook_application_secr']; // try ZendOAuth $this->options['callbackUrl'] = $this->getURL(); $this->options['requestTokenUrl'] = 'https://graph.facebook.com/' . $this->graphVersion . '/oauth/access_token'; $consumer = new ZendOAuth\Consumer($this->options); $httpClient = TikiLib::lib('tiki')->get_http_client(); $consumer->setHttpClient($httpClient); $customServiceParameters = [ 'client_id' => $prefs['socialnetworks_facebook_application_id'], 'client_secret' => $prefs['socialnetworks_facebook_application_secr'], 'redirect_uri' => $this->getURL(), 'code' => $_REQUEST['code'] ]; /** @var ZendOAuth\Token\Request $token */ $token = $consumer->getRequestToken($customServiceParameters); $resp = $token->getResponse(); $ret = $resp->getContent(); } $json_decoded_ret = json_decode($ret, true);


Same issue, white screen.

There are no comments at this time.