bshaffer / oauth2-server-php-docs

documentation for the oauth2-server-php library
231 stars 148 forks source link

Unsupported operand types #6

Closed yankeeinlondon closed 11 years ago

yankeeinlondon commented 11 years ago

In an attempt to get a simple test of the "Resource Owner Password" workflow working I ran into an Unsupported operand types PHP error in the AuthorizeController.php (line 74):

$clientData += array('redirect_uri' => null); // this should be set.  We should create ClientData interface

I haven't dug deeply into this as I'm not sure how deep the rabbit hole goes but I did put a debug line in right before to check what my "query" string is in the request and I get the following:

[query] => Array
    (
        [grant_type] => client_credentials
        [redirect_uri] => http://fake.url.com
        [username] => testclient
        [password] => testpass
        [client_id] => 1
    )

This is what I was expecting it to send so I'm at a loss. I'm hoping that I'm doing something obviously wrong and someone can quickly point me to the fault. It might also be a bug? I don't know at this stage.

yankeeinlondon commented 11 years ago

One update, I was using client_credentials where I should have been using user_credentials. In any event, changing the grant type unfortunately doesn't change the error I get.

    (
        [grant_type] => user_credentials
        [redirect_uri] => http://fake.url.com
        [username] => testclient
        [password] => testpass
        [client_id] => 1
    )
bshaffer commented 11 years ago

I believe you are using an outdated version of the library. The error file/line indicated does not contain the code you supplied: AuthorizeController.php#L74

yankeeinlondon commented 11 years ago

Well yes I suppose it isn't ... its the v0.3 that Arul has integrated with Restler. I'll push it to the latest and see if this helps.