-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to get token with 2.0.0 #62
Comments
Did you make sure, that this redirect URL is set for the client in the developer portal? |
similar issue here! Any Ideas? |
I've had some problems logging in, instead user name I had to provide e-mail address. Maybe something similar? |
I read Viessmann documentation and I'm able now to connect without PHP library. If you want to avoid that (for an automatic script which refresh every minutes for example), you need to set scope to IoT User offline_access to get a refresh_token which allows to get a fresh token without manual login. With a simple call, I'm able to retrieve all data from my boiler. Example of a simple script when u have your refresh_token
Viessmann Oauth documentation to get a refresh_token: |
Indeed the api is more simple and documented in the iot version. I think
that the added value of my previous work was more in the reverse
engineering than the code itself. Feature has become a common concept of
the api and client are already used to get data from their viessmann's
device. With the new iot documentation, I'm not sure that my client is
still valuable. I did the switch for backward compatibility but think that
you should switch to direct integration with the iot api.
Regards
Le sam. 17 juil. 2021 à 16:38, 0rsa ***@***.***> a écrit :
… I read Viessmann documentation and I'm able now to connect without PHP
library.
As viessmann API uses now OAuth, you have to login manually via a Viessman
login form, then the form is redirecting you to your redirect_uri.
If you want to avoid that (for an automatic script which refresh every
minutes for example), you need to set scope to IoT User offline_access to
get a refresh_token which allows to get a fresh token without manual login.
With a simple call, I'm able to retrieve all data from my boiler.
Example of a simple script when u have your refresh_token
$token = json_decode(exec('curl -X POST "https://iam.viessmann.com/idp/v2/token" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=refresh_token&client_id=CLIENT_ID&refresh_token=REFRESH_TOKEN"'));
echo exec('curl -X GET https://api.viessmann.com/iot/v1/equipment/installations/INSTALLATION_ID/gateways/GATEWAY_SERIAL/devices/0/features -H "Authorization: Bearer '.$token->access_token.'"');
Viessmann Oauth documentation to get a refresh_token:
https://developer.viessmann.com/en/doc/authentication
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#62 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEH4GUZUE25V3SR3VF7MATLTYGIV7ANCNFSM5AQYBTHQ>
.
|
Some people, told me that they did a password recovering to fix the problem. Seems that password with special character lead to some problem. Maybe it's in my implementation but can't check right now. |
Hi, |
Thanks for the feedback. I will try to fix this to avoid the double quote |
I did a fix that should correctly parse php reserved char($,...). |
Hi,
|
Hello,
v2.0.0
I use credentials.properties correctly filled and I followed instructions provided for this new version (thank you!)
I have this error:
Message: Error during authentication process. Please review your username/password Code: 0 Message: response didn't contains code to get token probably due to an error in authentication process. Response : {"error":"Invalid redirection URI."} Code: 0
Error seems to be related to redirect URI.
I'm still investigating.
Oauth/ViessmannOauthClientImpl.php
l.38
const REDIRECT_URL = "http://localhost:4200/";
The text was updated successfully, but these errors were encountered: