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

How to develop a headless service login



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.






Akzeptierte Lösungen

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


Thanks to @nerixs 

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
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?



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 . As described in article, this request always leads to a login page, which requires human interaction.

As I understand your article 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:

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