uafrica / oauth-server

OAuth Server
Other
51 stars 51 forks source link

Wrong $ownerModel table ? #36

Open ikkysleepy opened 8 years ago

ikkysleepy commented 8 years ago

When trying to authenticate with access token, I noticed that I was getting an internal error. The error was because the $ownerModel was saved as 'client' and not 'oauth_clients'. Adding this code to OAuthAuthenication.php seems to allow me to authenticate with the token:

line 162

            if($ownerModel == 'client'){
                $ownerModel = 'oauth_clients';
            }

See my notes on this comment: https://github.com/uafrica/oauth-server/issues/1#issuecomment-218228803

I changed the url to be: http://localhost:8888/users/alexa/1.json?access_token=3HZra4PSXAWKnnHpjZrmENXIKOk97R0qPttU1z4N

The Question remains, where do I need to put this code:

        $accessToken = $this->request->query('access_token');
        $http = new Client([
            'headers' => ['Authorization' => 'Bearer ' . $accessToken]
        ]);

In a related matter, how can the Auth user to be set after the the token has been verified? $this->set('user', $this->Auth->user())

irongomme commented 7 years ago

I'm interested too !