Comments (7)
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?
from laravel-philips-hue.
I'll be running tests this afternoon to see if I can replicate this and solve the issue.
from laravel-philips-hue.
Amazing, thank you (happy to supply any further logs or diagnosis to help).
thanks
from laravel-philips-hue.
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)
from laravel-philips-hue.
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!
from laravel-philips-hue.
** 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?
from laravel-philips-hue.
I had the same issue, the fix is in PR #15
from laravel-philips-hue.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-philips-hue.