abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 
Beantwortet! Gehe zur Lösung.

How to develop a headless service login

Hello,

 

I'm just trying to figure out, how to develop a reliable service login with your API.

Actually it is not clear to me, how to do it WITHOUT a webpage - and this way a human interaction.

 

(Maybe just write a web scrapper and fill in the values?)

 

What's the recommandation for a headless service?

 

User Story:

For my familiy members living at home and just want to have a warm home at the right time, the heating should be set depending whether someone is at home or not automatically WITHOUT manual interaction.

To achieve this, I want to call the viessmann API when somebody reaches or leaves our home.

 

Calling a web page to authenticate is neither smart, nor automatic. Also all other ways with human interaction are useless.

 

Generating an access and refresh token and constantly refresh it, also assumes that the server runs the whole time --> wrong assumption, this is not fail safe.

 

I'm happy to get suggestions that work.

 

Regards

 

 

1 AKZEPTIERTE LÖSUNG

Akzeptierte Lösungen
6 ANTWORTEN 6

OK just found the "answer" - it is a web scrapper kind of thing:

https://www.viessmann-community.com/t5/Getting-started-programming-with/To-help-get-started/td-p/181...

 

Thanks to @nerixs 

Hello,
I would like to build a small .NET Core Application having a machine to machine communication to the Viessmann API. Authentication with the API should be without human interaction, as described in ul0815's request above.

 

So far I came accross @nerixs' solution described in https://www.viessmann-community.com/t5/Getting-started-programming-with/To-help-get-started/td-p/181...
Unfortunately I was not able to port this to a .NET Core environment so far.

 

Can anybody tell me how to port @nerixs' solution to .NET Core environment or more generally how to setup the authentication calls to work in a machine to machine environment?

 

Regards

Hello @Boeb,
Machine-to-machine communication with the API? 
I don't understand what you want to do?

Hello @nerixs 
Thank you for your reply.

 

I'll have a try for a better description of my goal and the issue im am facing:

 

My goal is to write a web application, where my users authenticate with their specific credentials, independent from the Viessmann API.

On this web applications the users shall be able to initiate certain actions, which subsequently lead to calls on the Viessmann API. The authentication needed for the API-calls shall happen programmatically, without any user interaction. Let's say, my web application does authenticate with the Viessmann API, therefore "machine to machine communication".

 

The issue I am facing now is "Step 1: Authorization request" according to https://documentation.viessmann.com/static/authentication . As described in article, this request always leads to a login page, which requires human interaction.

As I understand your article https://www.viessmann-community.com/t5/Getting-started-programming-with/To-help-get-started/td-p/181... it describes a way how to do this authorization request without human interaction using php.

 

My question now is how this can be done in a .NET Core application.
Or as more general answer, if there is specific API request where I can achieve this and how this would look like.

Your users must register a new OAuth 2.0 client
Then via:
https://documentation.viessmann.com/users/v1

User management must be possible.
I don't know how to tell you more.

hello @Boeb,

the first step (Authorization Request) always works (almost) exactly as shown in the documentation.

For demonstration puposes, Viessmann used a browser to make the call with the bogus listening/webhook address of http://localhost:4200. This of course results in a browser error message but the authorization code is created nonetheless as part of the URL shown in the browsers address line.

To automate this, you need a calling app that is also providing your credentials automatically. Viessmannn responds to the request by sending stuff to the Redirect URI. Your app has to listen to the redirect URI. The URI can be anything but has to be set and saved in the edit client window of the developer portal.

I'm using Node-Red running on a Raspberry Pi. Node-Red is using portnumber 1880 for html responses, hence the Redirect URI is set to http://localhost:1880

Frankly, I'm not sure why you want to use .NET for this - unless you have a low power consuming hardware on which it runs. Using the API in a 24/7 fashion definitely isn't something for a desktop computer. It's much  easier to have the Interface to Viessmann running on a Raspberry Pi or similar and access it with a browser. Or do you intend to duplicate Viessmann's ViCare App on a mobile device?

Also this article could be helpful in understanding the Authorization Request. Also some of my other articles and tutorials in this forum might provide more info.

 

Hope this helps.

Kind regards

Chris