<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Thema "Re: Step 2: Authorization code exchange ==&amp;gt; invalid-token-request" in Getting started programming with the Viessmann API</title>
    <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232026#M183</link>
    <description>&lt;P&gt;Sorry if I have to ask again. For the definiton of the client within the Developer Portal, have you put "&lt;A href="http://sub.domain.tld" target="_blank"&gt;http://sub.domain.tld&lt;/A&gt;" as Redirect URI? If you have just put "sub.domain.tld" there, then it would not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the code verifier / challenge, we used the same in the example, which is working but might not always be recommended. However, I just wanted to exclude potential error sources during the testing so that you get a first authorization successfully done &lt;span class="lia-unicode-emoji" title=":leicht_lächelndes_Gesicht:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 Apr 2022 12:34:44 GMT</pubDate>
    <dc:creator>MichaelHanna</dc:creator>
    <dc:date>2022-04-13T12:34:44Z</dc:date>
    <item>
      <title>Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/231992#M179</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'm new here and trying to use the API so created a client id in the&amp;nbsp;&lt;SPAN&gt;Developer Portal and a code chalenge/verifier using th github tool in the doc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;client id : &lt;FONT color="#FF00FF"&gt;xxx&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;url :&lt;FONT color="#3366FF"&gt; yyy&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;code challenge : &lt;FONT color="#00FF00"&gt;zzz&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;code verif : &lt;FONT color="#FFCC00"&gt;aaa&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I accessed the url with a browser :&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;A href="https://iam.viessmann.com/idp/v2/authorize?client_id=xxx&amp;amp;redirect_uri=http://yyy&amp;amp;response_type=code&amp;amp;code_challenge=zzz&amp;amp;scope=IoT%20User" target="_blank" rel="noopener"&gt;https://iam.viessmann.com/idp/v2/authorize?client_id=&lt;EM&gt;&lt;FONT color="#FF00FF"&gt;xxx&lt;/FONT&gt;&lt;/EM&gt;&amp;amp;redirect_uri=http://&lt;EM&gt;&lt;FONT color="#3366FF"&gt;yyy&lt;/FONT&gt;&lt;/EM&gt;&amp;amp;response_type=code&amp;amp;code_challenge=&lt;EM&gt;&lt;FONT color="#00FF00"&gt;zzz&lt;/FONT&gt;&lt;/EM&gt;&amp;amp;scope=IoT%20User&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Then got the code from the redirect url&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;code : &lt;FONT color="#00CCFF"&gt;bbb&lt;/FONT&gt;&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;curl -X POST "&lt;A href="https://iam.viessmann.com/idp/v2/token" target="_blank" rel="noopener"&gt;https://iam.viessmann.com/idp/v2/token&lt;/A&gt;" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=authorization_code&amp;amp;client_id=&lt;EM&gt;&lt;FONT color="#FF0000"&gt;xxx&lt;/FONT&gt;&lt;/EM&gt;&amp;amp;redirect_uri=http://&lt;EM&gt;&lt;FONT color="#3366FF"&gt;yyy&lt;/FONT&gt;&lt;/EM&gt;&amp;amp;code_verifier=&lt;EM&gt;&lt;FONT color="#FFCC00"&gt;aaa&lt;/FONT&gt;&lt;/EM&gt;&amp;amp;code=&lt;EM&gt;&lt;FONT color="#00CCFF"&gt;bbb&lt;/FONT&gt;&lt;/EM&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;btw, I also tried with postman instead of curl.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;and everytime I get :&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"error"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"invalid-token-request"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I'm open for any idea about what I'm doing wrong !&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks in advance !&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Apr 2022 11:08:32 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/231992#M179</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-13T11:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232004#M180</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/50249"&gt;@Kevinski&lt;/a&gt; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am happy to hear that you want to tryout our API! I am happy to support you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One thing I noticed in your description is that for the parameters of your client, you define "yyy" as the redirect URI. When looking at your request for the 2nd step of the authorization, the redirect URI in the URL is "&lt;A href="http://yyy" target="_blank"&gt;http://yyy&lt;/A&gt;". Have you also put the "http://" in the definition of the redirect URI for the client? I assume this is the case, but would like to make this sure because it could be misunderstood based on what you wrote.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, please try to execute the 1st step in an incognito window. This could also help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lastly, you could try the code challenge / verifier combination from the example given in the documentation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 11:35:45 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232004#M180</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-04-13T11:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232007#M181</link>
      <description>&lt;P&gt;Hello Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for you quick reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The url used in the actual api url is correct. Let's just say the url variable in that "code" is url : sub.domain.tld&lt;/P&gt;&lt;P&gt;so in the query it's actually &lt;A href="http://sub.domain.tld" target="_blank"&gt;http://sub.domain.tld&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll try to execute step 1 in incognito and let you know !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 11:42:45 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232007#M181</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-13T11:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232009#M182</link>
      <description>&lt;P&gt;I tried in Incognito and it does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also I noticed something weird when trying your 3rd solution : the code_verifier and code_challenge values are the same in the doc (cf attachment)&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 11:50:33 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232009#M182</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-13T11:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232026#M183</link>
      <description>&lt;P&gt;Sorry if I have to ask again. For the definiton of the client within the Developer Portal, have you put "&lt;A href="http://sub.domain.tld" target="_blank"&gt;http://sub.domain.tld&lt;/A&gt;" as Redirect URI? If you have just put "sub.domain.tld" there, then it would not work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the code verifier / challenge, we used the same in the example, which is working but might not always be recommended. However, I just wanted to exclude potential error sources during the testing so that you get a first authorization successfully done &lt;span class="lia-unicode-emoji" title=":leicht_lächelndes_Gesicht:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 12:34:44 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232026#M183</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-04-13T12:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232031#M184</link>
      <description>&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the actual urls used in my last test (i also tried with an actual domain name i own) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;step 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://iam.viessmann.com/idp/v2/authorize?client_id=xxxxx&amp;amp;redirect_uri=http://127.0.0.1:5555/&amp;amp;response_type=code&amp;amp;code_challenge=xxxxxxx&amp;amp;scope=IoT%20User" target="_blank" rel="noopener"&gt;https://iam.viessmann.com/idp/v2/authorize?client_id=xxxxx&amp;amp;redirect_uri=http://127.0.0.1:5555/&amp;amp;response_type=code&amp;amp;code_challenge=xxxxxxx&amp;amp;scope=IoT%20User&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;step 2:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;curl -X POST "&lt;A href="https://iam.viessmann.com/idp/v2/token" target="_blank" rel="noopener"&gt;https://iam.viessmann.com/idp/v2/token&lt;/A&gt;" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=authorization_code&amp;amp;client_id=xxxxxxxx&amp;amp;redirect_uri=&lt;A href="http://127.0.0.1:5555/&amp;amp;code_verifier=xxxxxxxxx&amp;amp;code=xxxxxxxxxx" target="_blank" rel="noopener"&gt;http://127.0.0.1:5555/&amp;amp;code_verifier=xxxxxxxxx&amp;amp;code=xxxxxxxxxx&lt;/A&gt;"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Edit : I also tried with the code verifier / challenge provided in the doc, no luck &lt;span class="lia-unicode-emoji" title=":verwirrtes_Gesicht:"&gt;😕&lt;/span&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Edit2 : Tried to delete and recreate a client with a different client id in the&amp;nbsp;&lt;SPAN&gt;Developer Portal... still no luck&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 13 Apr 2022 12:58:32 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232031#M184</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-13T12:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232070#M185</link>
      <description>&lt;P&gt;Could you please tryout in Postman to see if it works for you? Here is a collection you can use as a template for the requests (it is not possible to upload a .json file here, so please copy the text into a textfile and change the file format to .json)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if it works for you. Otherwise I am happy to send you the Postman collection via mail.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"info": {&lt;BR /&gt;&amp;nbsp;"_postman_id": "64e6ad3a-b1dd-4fef-995b-a23972fc3fab",&lt;BR /&gt;&amp;nbsp;"name": "VIessmann API - Authentication",&lt;BR /&gt;&amp;nbsp;"description": "This is a Postman collection for the Viessmann API. It contains the following section:\n\n* &amp;nbsp; Authentication\n &amp;nbsp; &amp;nbsp;\n\nFor general steps to get started, please go to the API documentation page 'getting started': [&lt;A href="https://documentation.viessmann.com/static/get-started](https://documentation.viessmann.com/static/get-started" target="_blank"&gt;https://documentation.viessmann.com/static/get-started](https://documentation.viessmann.com/static/get-started&lt;/A&gt;)",&lt;BR /&gt;&amp;nbsp;"schema": "&lt;A href="https://schema.getpostman.com/json/collection/v2.1.0/collection.json" target="_blank"&gt;https://schema.getpostman.com/json/collection/v2.1.0/collection.json&lt;/A&gt;"&lt;BR /&gt;},&lt;BR /&gt;"item": [&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; "name": "Authorization request",&lt;BR /&gt;&amp;nbsp; "request": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"method": "GET",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"header": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"key": "Content-Type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"name": "Content-Type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"value": "application/x-www-form-urlencoded",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"type": "text"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"url": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "raw": "&lt;A href="https://iam.viessmann.com/idp/v2/authorize?client_id={{client_id}}&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;response_type=code&amp;amp;code_challenge={{code_challenge}}&amp;amp;scope=IoT" target="_blank"&gt;https://iam.viessmann.com/idp/v2/authorize?client_id={{client_id}}&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;response_type=code&amp;amp;code_challenge={{code_challenge}}&amp;amp;scope=IoT&lt;/A&gt; User offline_access",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "protocol": "https",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "host": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"iam",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"viessmann",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"com"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "path": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"idp",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"v2",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"authorize"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "query": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "client_id",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{client_id}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "redirect_uri",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "&lt;A href="http://localhost:4200/" target="_blank"&gt;http://localhost:4200/&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "response_type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "code"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "code_challenge",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{code_challenge}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "scope",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "IoT User offline_access"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"description": "The /authorize endpoint of our IAM platform is used to request an authorization code."&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "response": []&lt;BR /&gt;&amp;nbsp;},&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; "name": "Authorization code exchange",&lt;BR /&gt;&amp;nbsp; "request": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"method": "POST",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"header": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"key": "Content-Type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"name": "Content-Type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"value": "application/x-www-form-urlencoded",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"type": "text"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"body": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "mode": "urlencoded",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "urlencoded": []&lt;BR /&gt;&amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"url": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "raw": "&lt;A href="https://iam.viessmann.com/idp/v2/token?grant_type=authorization_code&amp;amp;client_id={{client_id}}&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;code_verifier={{code_challenge}}&amp;amp;code={{code" target="_blank"&gt;https://iam.viessmann.com/idp/v2/token?grant_type=authorization_code&amp;amp;client_id={{client_id}}&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;code_verifier={{code_challenge}}&amp;amp;code={{code&lt;/A&gt;}}",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "protocol": "https",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "host": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"iam",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"viessmann",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"com"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "path": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"idp",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"v2",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"token"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "query": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "grant_type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "authorization_code"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "client_id",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{client_id}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "redirect_uri",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "&lt;A href="http://localhost:4200/" target="_blank"&gt;http://localhost:4200/&lt;/A&gt;"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "code_verifier",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{code_challenge}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "code",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{code}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"description": "With the authorization code you can request an access token."&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "response": []&lt;BR /&gt;&amp;nbsp;},&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; "name": "Authorization code exchange - with Refresh Token",&lt;BR /&gt;&amp;nbsp; "request": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"method": "POST",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"header": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"key": "Content-Type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"name": "Content-Type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"value": "application/x-www-form-urlencoded",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"type": "text"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp;],&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"body": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "mode": "urlencoded",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "urlencoded": []&lt;BR /&gt;&amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"url": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "raw": "&lt;A href="https://iam.viessmann.com/idp/v2/token?client_id={{client_id}}&amp;amp;grant_type=refresh_token&amp;amp;refresh_token={{refresh_token" target="_blank"&gt;https://iam.viessmann.com/idp/v2/token?client_id={{client_id}}&amp;amp;grant_type=refresh_token&amp;amp;refresh_token={{refresh_token&lt;/A&gt;}}",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "protocol": "https",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "host": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"iam",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"viessmann",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"com"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "path": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"idp",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"v2",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;"token"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ],&lt;BR /&gt;&amp;nbsp; &amp;nbsp; "query": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "client_id",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{client_id}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "grant_type",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "refresh_token"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "key": "refresh_token",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "value": "{{refresh_token}}"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;},&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"description": "With the authorization code you can request an access token."&lt;BR /&gt;&amp;nbsp; },&lt;BR /&gt;&amp;nbsp; "response": []&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;],&lt;BR /&gt;"event": [&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; "listen": "prerequest",&lt;BR /&gt;&amp;nbsp; "script": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"type": "text/javascript",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"exec": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ""&lt;BR /&gt;&amp;nbsp; &amp;nbsp;]&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;},&lt;BR /&gt;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp; "listen": "test",&lt;BR /&gt;&amp;nbsp; "script": {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"type": "text/javascript",&lt;BR /&gt;&amp;nbsp; &amp;nbsp;"exec": [&lt;BR /&gt;&amp;nbsp; &amp;nbsp; ""&lt;BR /&gt;&amp;nbsp; &amp;nbsp;]&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 16:01:49 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232070#M185</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-04-13T16:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232109#M186</link>
      <description>&lt;P&gt;Thank you for your time Michael, unfortunately it does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you're ok with that I could send you a private message with a detailed screenshot with visible client id and such ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 19:46:08 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232109#M186</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-13T19:46:08Z</dc:date>
    </item>
    <item>
      <title>Betreff: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232118#M187</link>
      <description>&lt;P&gt;I'm facing exact the idential issue. Using Postmaster or curl command, I always get&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"error": "invalid-token-request"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Here is the url request for reference:&lt;/P&gt;&lt;P&gt;&lt;A href="https://iam.viessmann.com/idp/v2/token" target="_blank"&gt;https://iam.viessmann.com/idp/v2/token&lt;/A&gt;?&lt;/P&gt;&lt;P&gt;client_id= ....verified as per my account&lt;/P&gt;&lt;P&gt;redirect_uri=&lt;A href="http://localhost:4200/" target="_blank"&gt;http://localhost:4200/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;grant_type=authorization_code&lt;/P&gt;&lt;P&gt;code_verifier=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&lt;/P&gt;&lt;P&gt;code= xxxx that's the code I received from step 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Need to take a brake now to reflect...&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2022 20:51:24 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232118#M187</guid>
      <dc:creator>bg24</dc:creator>
      <dc:date>2022-04-13T20:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232140#M188</link>
      <description>&lt;P&gt;&lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/50249"&gt;@Kevinski&lt;/a&gt; sure you can send me the information via direct message.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, when you get the error in step 2, please immediately try again, starting from step 1. Let me know if second (or third) attempt works for you.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 05:59:13 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232140#M188</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-04-14T05:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232154#M189</link>
      <description>&lt;P&gt;&lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/29136"&gt;@MichaelHanna&lt;/a&gt;&amp;nbsp;Thanks for your answer, I tried 3 times in a row (getting a new code each time) and still the same issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried a 4th time changing code challenge / verif to&amp;nbsp;&lt;SPAN&gt;2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c and it worked... once&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried a 5th,6th, 7th time with "IoT User offline_access" instead of "IoT User" for the scope and no more luck...(changing the code in step 2 each time with the one i got in step 1)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not sure what is wrong but something's not right somewhere &lt;span class="lia-unicode-emoji" title=":verwirrtes_Gesicht:"&gt;😕&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 06:48:14 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232154#M189</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-14T06:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232156#M190</link>
      <description>&lt;P&gt;Thanks for your additional attempts. I will check with out IT to have a closer look why the authorization attempts fail. I will let you know when I get an answer on this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, happy to receive your screenshot and the complete requests you are executing.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 06:53:31 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232156#M190</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-04-14T06:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232167#M191</link>
      <description>&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;I just sent you a pm with the complete requests.&lt;/P&gt;&lt;P&gt;Thanks for your time !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2022 07:04:54 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232167#M191</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-14T07:04:54Z</dc:date>
    </item>
    <item>
      <title>Betreff: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232481#M192</link>
      <description>&lt;P&gt;Hello, I have the same problem.&amp;nbsp;I'm currently trying out the API and failing at authentication in the second step with&amp;nbsp;&lt;SPAN&gt;"error"&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"invalid-token-request".&amp;nbsp;I've tried curl and postman.&amp;nbsp;No matter what I do, I always get this error.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Authorization request works fine:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="https://iam.viessmann.com/idp/v2/authorize?client_id={ID_FROM_DASHBOARD}&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;response_type=code&amp;amp;code_challenge=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&amp;amp;scope=IoT" target="_blank"&gt;https://iam.viessmann.com/idp/v2/authorize?client_id={ID_FROM_DASHBOARD}&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;response_type=code&amp;amp;code_challenge=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&amp;amp;scope=IoT&lt;/A&gt; User offline_access&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Authorization code request fails:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;A href="https://iam.viessmann.com/idp/v2/token?grant_type=authorization_code&amp;amp;client_id={ID_FROM_DASHBOARD}&amp;amp;redirect_uri=http://localhost:4200&amp;amp;code_verifier=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&amp;amp;code={CODE_FROM_FIRST_AUTHORIZATION_REQUEST" target="_blank"&gt;https://iam.viessmann.com/idp/v2/token?grant_type=authorization_code&amp;amp;client_id={ID_FROM_DASHBOARD}&amp;amp;redirect_uri=http://localhost:4200&amp;amp;code_verifier=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&amp;amp;code={CODE_FROM_FIRST_AUTHORIZATION_REQUEST&lt;/A&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;*{} are placeholder for the values/codes&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Can you check your system function please or am I doing something wrong?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Apr 2022 10:19:25 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232481#M192</guid>
      <dc:creator>VLaubsch</dc:creator>
      <dc:date>2022-04-17T10:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Betreff: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232675#M193</link>
      <description>&lt;P&gt;I got the information that the expiration time of the code in step 1 is set to 20 seconds due to security reasons. This means to obtain a refresh token / access token, step 2 must be executed below 20 seconds after code creation.&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/50371"&gt;@VLaubsch&lt;/a&gt; please check if this works for you. &lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/50249"&gt;@Kevinski&lt;/a&gt; already confirmed that this worked. &lt;span class="lia-unicode-emoji" title=":leicht_lächelndes_Gesicht:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 07:54:37 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232675#M193</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-04-19T07:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232676#M194</link>
      <description>&lt;P&gt;Michael Helped a lot with the issue and he found out that they recently changed the TTL for the step 1 code to 20 seconds.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Authentification must then be done with a script in order to be fast enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's an example providing that you can setup a local apache server on port 4200 or add another valid "&lt;SPAN&gt;Redirect URI" of your choice to the API client.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index.php file accessible at &lt;A href="http://localhost:4200" target="_blank" rel="noopener"&gt;http://localhost:4200&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;lt;?php&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;$clientid&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'xxx'&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;//your actual client id&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$code_verif&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;'2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c'&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;SPAN&gt;//viessmann's working code verif example&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;$url&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;'&lt;A href="https://iam.viessmann.com/idp/v2/token" target="_blank" rel="noopener"&gt;https://iam.viessmann.com/idp/v2/token&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$data&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;array&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'grant_type'&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;'authorization_code'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'client_id'&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;$clientid&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'redirect_uri'&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;'&lt;A href="http://localhost:4200/" target="_blank" rel="noopener"&gt;http://localhost:4200/&lt;/A&gt;'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'code_verifier'&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;$code_verif&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'code'&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;$_GET&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;'code'&lt;/SPAN&gt;&lt;SPAN&gt;]);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;$options&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;array&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'http'&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;array&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'header'&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;=&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;"Content-type: application/x-www-form-urlencoded&lt;/SPAN&gt;&lt;SPAN&gt;\r\n&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'method'&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;=&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;'POST'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'content'&lt;/SPAN&gt;&lt;SPAN&gt; =&amp;gt; &lt;/SPAN&gt;&lt;SPAN&gt;http_build_query&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$data&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$context&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp;= &lt;/SPAN&gt;&lt;SPAN&gt;stream_context_create&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$options&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$result&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;file_get_contents&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$url&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;$context&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var_dump&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;$result&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;After that just call&amp;nbsp;&lt;A href="https://iam.viessmann.com/idp/v2/authorize?client_id=###your actual client id###&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;response_type=code&amp;amp;code_challenge=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&amp;amp;scope=IoT User offline_access" target="_self"&gt;https://iam.viessmann.com/idp/v2/authorize?client_id=###your actual client id###&amp;amp;redirect_uri=http://localhost:4200/&amp;amp;response_type=code&amp;amp;code_challenge=2e21faa1-db2c-4d0b-a10f-575fd372bc8c-575fd372bc8c&amp;amp;scope=IoT User offline_access&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;from a browser (don't forget to change&amp;nbsp; ###your actual client id### to the correct value, the code_challenge value is the one from viessmann's example (a working one).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;After you log in with your viessmann account it'll redirect to your localhost:4200 script and get you the step 2 access and refresh token.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Hope it helps &lt;span class="lia-unicode-emoji" title=":leicht_lächelndes_Gesicht:"&gt;🙂&lt;/span&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 19 Apr 2022 08:03:30 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/232676#M194</guid>
      <dc:creator>Kevinski</dc:creator>
      <dc:date>2022-04-19T08:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/234077#M198</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;My integration works well till 13.04.2022 21:00, request to API since 21:15 failed with error invalid-token-request&lt;/P&gt;&lt;P&gt;No changes in my integration.&lt;/P&gt;&lt;P&gt;I tried to refresh token manually (Step 1) for few times but result still the same.&lt;/P&gt;&lt;P&gt;My integration have requests (step 1 and step 2) exactly as described here. Everything the same and previously the same requests works correctly.&lt;/P&gt;&lt;P&gt;I also do step 2 quickly (about 10 seconds) after step 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am lost.&lt;/P&gt;&lt;P&gt;Any ideas please?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 19:03:24 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/234077#M198</guid>
      <dc:creator>sbtnk</dc:creator>
      <dc:date>2022-04-27T19:03:24Z</dc:date>
    </item>
    <item>
      <title>Betreff: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/253393#M221</link>
      <description>&lt;P&gt;I am having exactly the same troubles as&amp;nbsp;&lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/50777"&gt;@sbtnk&lt;/a&gt;&amp;nbsp;&amp;nbsp;. Is there any solution?&lt;/P&gt;</description>
      <pubDate>Sun, 28 Aug 2022 08:57:06 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/253393#M221</guid>
      <dc:creator>ArrowX</dc:creator>
      <dc:date>2022-08-28T08:57:06Z</dc:date>
    </item>
    <item>
      <title>Betreff: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/253572#M222</link>
      <description>&lt;P&gt;Since yesterday morning I have the same problem. My integration worked for several months. If I remember correctly there was some viessmann maintenance work during the weekend. Maybe they have changed the authentication...!?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 09:36:37 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/253572#M222</guid>
      <dc:creator>cb1000r</dc:creator>
      <dc:date>2022-08-29T09:36:37Z</dc:date>
    </item>
    <item>
      <title>Re: Step 2: Authorization code exchange ==&gt; invalid-token-request</title>
      <link>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/253799#M223</link>
      <description>&lt;P&gt;Hi everyone, the maintenance work on the weekend did not change anything on the authentication for the API.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general, refresh tokens have a lifetime (TTL) of 180 days.&lt;/P&gt;
&lt;P&gt;For creating a new refresh/access token, you can try and use the following postman collection, which contains the relevant API calls: &lt;A href="https://www.postman.com/vimicho/workspace/viessmann-api-public/collection/12055031-17157e90-a2e8-47b6-a7b8-2320c2941db3?action=share&amp;amp;creator=12055031" target="_blank"&gt;https://www.postman.com/vimicho/workspace/viessmann-api-public/collection/12055031-17157e90-a2e8-47b6-a7b8-2320c2941db3?action=share&amp;amp;creator=12055031&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please make sure, like &lt;a href="https://community.viessmann.de/t5/user/viewprofilepage/user-id/50777"&gt;@sbtnk&lt;/a&gt; mentioned, that the code received in Step1 is only valid for 20 seconds, which means you have to execute Step2 of the authentication within those 20 seconds.&lt;/P&gt;
&lt;P&gt;If the problem still occurs, please let me know here once more.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Michael&lt;/P&gt;</description>
      <pubDate>Tue, 30 Aug 2022 08:00:12 GMT</pubDate>
      <guid>https://community.viessmann.de/t5/Getting-started-programming-with/Step-2-Authorization-code-exchange-gt-invalid-token-request/m-p/253799#M223</guid>
      <dc:creator>MichaelHanna</dc:creator>
      <dc:date>2022-08-30T08:00:12Z</dc:date>
    </item>
  </channel>
</rss>

