Note that there are some explanatory texts on larger screens.

plurals
  1. POExtending CakeDC users plugin for use with Opauth or OpenID
    primarykey
    data
    text
    <p>I am currently in the process of trying to extend the cakeDC users plugin. It is proving relatively difficult to integrate this plugin with the plugin for Opauth located here: </p> <p><a href="https://github.com/uzyn/cakephp-opauth" rel="nofollow">https://github.com/uzyn/cakephp-opauth</a></p> <p>For instance I want in my application the ability to register and login a user via facebook, google etc...</p> <p>I have been attempting this with the google implementation and I am able to retrieve data back from Google through the opauth plugin. My issues lies with what do I do with this information now? If I want to register this user with my App, I don't know the next steps to do this...</p> <p>This is what the data returned in the array looks like:</p> <pre><code>Array ( [auth] =&gt; Array ( [uid] =&gt; 1xxxxxxxxx1 [info] =&gt; Array ( [name] =&gt; xxx xxx [email] =&gt; xx.xx@xx.com [first_name] =&gt; xx [last_name] =&gt; xx ) [credentials] =&gt; Array ( [token] =&gt; #%*(&amp;)(*&amp;%)*^$^)($% [expires] =&gt; 2013-08-09T19:23:10+00:00 ) [raw] =&gt; Array ( [id] =&gt; 1XXXXXXXXXXXXX1 [email] =&gt; XXXX.XXXXX@XXXXX.com [verified_email] =&gt; 1 [name] =&gt; XXX XXX [given_name] =&gt; XXXX [family_name] =&gt; XXXXX [gender] =&gt; male [locale] =&gt; en [hd] =&gt; test.com ) [provider] =&gt; Google ) [timestamp] =&gt; 2013-08-09T18:23:11+00:00 [signature] =&gt; *#&amp;$&amp;$$&amp;$&amp;$&amp;$&amp;$$#### [validated] =&gt; 1 ) </code></pre> <p>It doesnt seem to me that there is a password token that stays generated to compare with but that isnt even the current blocker. The blocker resides in how to register this information into the cakeDC users plugin extended class. Any help is greatly appreciated, and I am sure I am not the only developer out there curious how to extend this pluging to be integrated with the Opauth plugin.</p> <p>EDITS: (** WORKING LOGIN CODE **)</p> <pre><code> public function beforeFilter() { $this-&gt;Auth-&gt;Allow('opauth_complete'); } public function opauth_complete() { $user = $this-&gt;set('opauth_data', $this-&gt;request-&gt;data); $loginUser = $this-&gt;User-&gt;find('first', array('fields'=&gt;array('User.*'), 'conditions'=&gt;array('User.email'=&gt;$this-&gt;request-&gt;data['auth']['info']['email']))); if ($this-&gt;request-&gt;is('post')) { if ($this-&gt;Auth-&gt;login($loginUser)) { //return $this-&gt;redirect($this-&gt;Auth-&gt;redirect()); $this-&gt;Session-&gt;setFlash(__('You are logged in.')); }else{ $this-&gt;Session-&gt;setFlash(__('You are currently not Authorized')); } } } </code></pre> <p>The hangup seems to be on $this->Auth->login($loginUser); It find the user in the database, and yet it still wont authorize them through the google account.</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.
 

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