Open flamnitka opened 3 years ago
I'll be running tests this afternoon to see if I can replicate this and solve the issue.
Amazing, thank you (happy to supply any further logs or diagnosis to help). thanks
Just to verify properly, did you do this on a local environment and did you shared your local environment?
I've just tried, I was able to visit /hue/auth and it send me to philips hue asking me for credentials.
So I am thinking you're missing some kind of credentials?
I discovered my issue, I was incorrectly placing the credentials as below.
Example listed: 'client_id' => env('PHILIPS_HUE_CLIENT_ID'), How I was incorrectly implementing: 'client_id' => env('abc123'), How to correctly implement: 'client_id' => 'abc1234',
Thanks for checking your code and confirming it was working, that helped me maintain focus on finding my issue. Also the packagist.org site now points to V1.6 as well, thank you.
*I am now having issue after the Hue Auth page. After clicking 'YES' on the authorize/trust Hue application page, my callback URL kicks in (...hue/auth/receive?code=xyz789&state=
) however I get the following error:
GuzzleHttp\Exception\ServerException
Server error: POST https://api.meethue.com/oauth2/token?code=xyz789&grant_type=authorization_code
resulted in a 500 Internal Server Error
response: {"fault":{"faultstring":"Invalid client identifier {0}","detail":{"errorcode":"oauth.v2.InvalidClientIdentifier"}}}
And this error page points to the following error location:
vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113
return new $className($message, $request, $response, $previous, $handlerContext);
As above, this might be due to me incorrectly implementing something so I'll keep debugging, however if by chance you recognize this error (or the "oauth.v2.InvalidClientIdentifier
" issue) and know the answer, I'd welcome any input you have.
Thanks again for your response and review, it's really great of you to help out and review! (oh and to answer your question, I had been running locally using XAMPP, however I'm now only running on hostgator to make sure it's all live)
Hello, I've continued to work on this and have tried many different ways, just keep getting the same error message. I've tried different version of Laravel, and have now setup it up on digitalocean, hostgator, and bluehost.
I'm able to go to mydomain.com/hue/auth
which then takes me to the Philips Hue website. I allow access on the Philips Hue page that asks "Do you trust this application?" and I click Yes. The callback URL then occurs and I'm presented the URL as below /hue/auth/receive?code=1234ABCD&state=
(the 1234ABCD changes to a different value each time I redo the process).
Below is the error I'm presented when the URL callback occurs (my callback URL set to domain.com/hue/auth/receive
)
500 Internal Server Error response: {"fault":{"faultstring":"Invalid client identifier {0}","detail":{"errorcode":"oauth.v2.InvalidClientIdentifier"}}}
I'm setting up and trying this code on new Laravel environments each time on different servers - any thought or ideas on what could be the issue would be great thank you
Additionally as a side note, if I simply go to the URL mydomain.com/hue/auth/receive
I get the below error (my folder permission is 755).
And even if I create a hue.json file in this location /var/www/html/storage/app/hue.json
I simply get another error that says "Trying to get property 'access_token_expires_at' of non-object")
And to clairfy my previous message, I'm now storing the following: "config/services.php" file contains 'client_id' => env('PHILIPS_HUE_CLIENT_ID'), ".env" file contains PHILIPS_HUE_CLIENT_ID=1234abcd6789efgh
Thank you again!
** I just tried forcing composer to use github build V1.4.1 and it worked!!!!
I believe there might be something incorrect in the authorization handling of V1.6 (possibly in the way credentials are identified or stored within Laravel, or how they are communicated to the Hue server).
To get my project working I used the below in terminal to force V1.4.1 into my Laravel project.
composer require cannonb4ll/laravel-philips-hue:1.4.1
I also tried a fresh Laravel project and tested with V1.5 (using composer require cannonb4ll/laravel-philips-hue:1.5
and was able to get to the above USER NAME screen as well - I think this again suggests something has gone wrong in V1.6 however once clicking on 'view lights' I do receive the following error "Undefined property: Philips\Hue\Resources\HueLightResource::$name (View: /var/www/html/vendor/cannonb4ll/laravel-philips-hue/resources/views/lights.blade.php)"
I suspect possibly these changes to the env variables may be part of the issue (however this is only my speculation).
Variables changed from env('PHILIPS_HUE_CLIENT_ID')
to config('services.philips-hue.client_id')
however they may not have been changed everywhere correctly?
I had the same issue, the fix is in PR #15
Hello, Thanks for the great work. I have been attempting to utilize laravel-philips-hue however I'm having some odd experiences, listed out some things I've noticed in case these help identify the issue. My core issue is that when I
http://{app-url}/hue/auth
I receive a standard{"ErrorCode" : "invalid_request", "Error" :"The request is missing required parameters."}
. Below is some areas where the issue might be occurring.composer require cannonb4ll/laravel-philips-hue
is grabbing version 1.5 (Oct 5th) instead of using the current dev-master (Oct 9th - 62aaa30). Not sure if anything needs to be changed on the packagist.org site. To solve this I've been using composerrequire cannonb4ll/laravel-philips-hue:dev-master
to force using the current master.Within HueClient.php & HueUser.php the below changes were made recently - should the "README.md" config area need to be update as well? The readme still directs that the
config/services.php
should useenv('PHILIPS_HUE_CLIENT_ID')
andenv('PHILIPS_HUE_CLIENT_SECRET')
.... The example of the changes I'm referencing can be seen here REMOVED:env('PHILIPS_HUE_APP_ID')
ADDED:config('services.philips-hue.app_id')
I'm receiving the following message once completing the
services.php
file and usinghttp://{app-url}/hue/auth
ERROR CODE:{"ErrorCode" : "invalid_request", "Error" :"The request is missing required parameters."}
This sadly is a very common / standard error code by Hue so I can't learn much from it. This is my main problem.As a side/bonus question: do you know of a clean and simple way to monitor the outbound post/get etc from Laravel so I can see the message it's sending when
http://{app-url}/hue/auth
is actioned? That way I could check the message I'm sendingThanks again, I hope the above helps solve this issue (if it exists in the repo) or if I'm doing something wrong please point me in the better direction.