<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MMM-Strava ID Unauthorized]]></title><description><![CDATA[<p dir="auto">Hello, I am getting client id not authorized, despite having my client ID and client secret correct (from Strava API page). I also have the whitelist setup correctly and can access my MM from my local browser (the MM itself is on a RPI4). I receive the link within the magic mirror and am redirected to the authorization page on Strava, but after clicking authorize and restarting MM, I am still getting the same client ID not authorized. In looking in electron, I do so a ERR_HTTP_HEADERS_SENT error message…</p>
<p dir="auto">Any help would be greatly appreciated. Screenshots below:</p>
<p dir="auto"><img src="/assets/uploads/files/1651330116025-f2d444fd-61bc-4e7f-94b2-a180257188f8-image.png" alt="f2d444fd-61bc-4e7f-94b2-a180257188f8-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1651330132045-6a8425b1-0669-460f-b80d-6cfd48077641-image.png" alt="6a8425b1-0669-460f-b80d-6cfd48077641-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1651330152759-cca44401-cc57-4b1c-8e41-94ce37928e5d-image.png" alt="cca44401-cc57-4b1c-8e41-94ce37928e5d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1651330188485-8ca1ea8d-e356-412f-9909-b93acbd67d3f-image.png" alt="8ca1ea8d-e356-412f-9909-b93acbd67d3f-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1651330286852-620ffa34-3669-4241-ad07-4c6334324201-image.png" alt="620ffa34-3669-4241-ad07-4c6334324201-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/topic/16708/mmm-strava-id-unauthorized</link><generator>RSS for Node</generator><lastBuildDate>Fri, 12 Jun 2026 20:14:55 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/16708.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 30 Apr 2022 14:51:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Tue, 20 Sep 2022 21:44:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> did you ever fixed this issue?</p>
<p dir="auto">I just had the same issue, and it turns out it was a permissions issue in the MagicMirror folder, I changed the permissions of the folder and re-authorized, it’s now working.</p>
<p dir="auto">Best regards</p>
]]></description><link>https://forum.magicmirror.builders/post/104657</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/104657</guid><dc:creator><![CDATA[rmonteroc]]></dc:creator><pubDate>Tue, 20 Sep 2022 21:44:55 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Tue, 03 May 2022 15:47:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> said in <a href="/post/101642">MMM-Strava ID Unauthorized</a>:</p>
<blockquote>
<p dir="auto">Cannot set headers after they are sent to the client</p>
</blockquote>
<p dir="auto">so, this error is typically caused by some code doing two sends for an incoming request</p>
<p dir="auto">the module sets up a little server to receive  and does a redirect response…</p>
<p dir="auto">but this could be an async problem<br />
start sending one response, continue while it runs and then fall into another send…  oops…</p>
<p dir="auto">I only made a cursory look at the code.    i have done similar things in some of my coding here and on other platforms.</p>
<p dir="auto">I don’t ‘see’ it, but there is a library in there too</p>
<p dir="auto">this says it is handling a callback on request complete,</p>
<p dir="auto">line 185 is  in the handling of the token auth . but the stravea lib is calling back into the function (function (err, payload, limits) at line 176<br />
so the node_helper called strava, who called us back at the function on line 185 ( (err, data) =&gt; {  (err, data) =&gt; { ) which does a redirect… WHILE the strava request to get the auth token handler is still active…</p>
<pre><code>			strava.oauth.getToken(authCode, function (err, payload, limits) {
				if (err) {
					console.error(err);
					res.redirect(`/${self.name}/auth/?error=${err}`);
					return;
				}
				// Store tokens
				self.saveToken(clientId, payload.body, (err, data) =&gt; {    // line 185
					// redirect route
					res.redirect(`/${self.name}/auth/?status=success`);
				});
			});
</code></pre>
<p dir="auto">line 451, is in the end of the saveFile() function, supposedly to save the tokens.json</p>
<pre><code>	saveToken: function (clientId, token, cb) {
		var self = this;
		this.readTokens();
		// No token for clientId - delete existing
		if (clientId in this.tokens &amp;&amp; !token) {
			delete this.tokens[clientId];
		}
		// No clientId in tokens - create stub
		if (!(clientId in this.tokens) &amp;&amp; token) {
			this.tokens[clientId] = {};
		}
		// Add token for client
		if (token) {
			this.tokens[clientId].token = token;
		}
		// Save tokens to file
		var json = JSON.stringify(this.tokens, null, 2);
		fs.writeFile(this.tokensFile, json, "utf8", function (error) {
			if (error &amp;&amp; cb) {
				cb(error);
			}
			if (cb) {
				cb(null, self.tokens);  // line 451  --- this calls back into the  ( (err, data) =&gt;)  function
			}
		})
</code></pre>
<p dir="auto">at FSReqCallback.oncomplete (node:fs:188:23) {</p>
]]></description><link>https://forum.magicmirror.builders/post/101643</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101643</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 03 May 2022 15:47:48 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Tue, 03 May 2022 14:38:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mumblebaj" aria-label="Profile: mumblebaj">@<bdi>mumblebaj</bdi></a> just removed the MMM-Strava module and installed from scratch. Still seeing the same issue. Would you by chance be able to do any direct troubleshooting with me? I am on discord in the MM channel and can dm you in there, if you have any free time at any point.</p>
<p dir="auto">Note: when I click the authorize button a the Stava auth site after being redirected there from my MM on the RPI, in Electron, I see this generated:</p>
<p dir="auto">[03.05.2022 10:13.13.537] [ERROR] Whoops! There was an uncaught exception…<br />
[03.05.2022 10:13.13.538] [ERROR] Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client<br />
at new NodeError (node:internal/errors:371:5)<br />
at ServerResponse.setHeader (node:_http_outgoing:576:11)<br />
at ServerResponse.header (/home/jberk1984/MagicMirror/node_modules/express/lib/response.js:776:10)<br />
at ServerResponse.location (/home/jberk1984/MagicMirror/node_modules/express/lib/response.js:893:15)<br />
at ServerResponse.redirect (/home/jberk1984/MagicMirror/node_modules/express/lib/response.js:931:18)<br />
at /home/jberk1984/MagicMirror/modules/MMM-Strava/node_helper.js:185:10<br />
at /home/jberk1984/MagicMirror/modules/MMM-Strava/node_helper.js:451:5<br />
at node:fs:2122:7<br />
at FSReqCallback.oncomplete (node:fs:188:23) {<br />
code: ‘ERR_HTTP_HEADERS_SENT’</p>
<p dir="auto">So the issue seems to be whatever is causing that. I never do see the token.js being generated after clicking the authorize button. My client and secret ID are correct in my config.js file (can’t tell you how many times I have checked to make sure)</p>
]]></description><link>https://forum.magicmirror.builders/post/101642</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101642</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Tue, 03 May 2022 14:38:53 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 19:17:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> not bad, maybe you didn’t know. lol</p>
]]></description><link>https://forum.magicmirror.builders/post/101633</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101633</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 02 May 2022 19:17:28 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 19:16:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> my bad, thanks! I corrected my post</p>
]]></description><link>https://forum.magicmirror.builders/post/101632</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101632</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Mon, 02 May 2022 19:16:31 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 19:02:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> u can edit your posts… don’t have to leave pad text, wrong info, bad tag…</p>
]]></description><link>https://forum.magicmirror.builders/post/101631</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101631</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Mon, 02 May 2022 19:02:45 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 19:16:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mumblebaj" aria-label="Profile: mumblebaj">@<bdi>mumblebaj</bdi></a>  I did attempt a reinstall of the MMM-Strava module but can certainly do it again. Is best method to rm-rf the MMM-Strava modiue folder and then redo the steps listed in the Github for MMM-Strava?</p>
]]></description><link>https://forum.magicmirror.builders/post/101626</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101626</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Mon, 02 May 2022 19:16:11 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 18:43:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mumblebaj" aria-label="Profile: mumblebaj">@<bdi>mumblebaj</bdi></a>  Thanks for the response.</p>
<ul>
<li>yes npm install was run the MMM-Strave folder</li>
<li>yes I did the browser auth on the RPI as well</li>
<li>no, I do not see a tokens file in the MMM-Strava folder after attempting the authorization:<br />
<img src="/assets/uploads/files/1651517000654-90f6ba7f-f899-400e-9237-eecf527d394f-image.png" alt="90f6ba7f-f899-400e-9237-eecf527d394f-image.png" class=" img-fluid img-markdown" /></li>
</ul>
]]></description><link>https://forum.magicmirror.builders/post/101625</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101625</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Mon, 02 May 2022 18:43:34 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 13:04:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> Let’s trace all the required steps.</p>
<ul>
<li>
<p dir="auto">Have run <code>npm install</code> in the MMM-Strava folder?</p>
</li>
<li>
<p dir="auto">Did you do the browser auth on the PI?</p>
</li>
<li>
<p dir="auto">Does the <code>tokens.json</code> file exist in the <code>MMM-Strava</code> folder and does it have the required information in it?  This should be created once the authorization step has been completed from the Browser on the RPi and should be populated with some token and user information.<br />
<img src="/assets/uploads/files/1651496576528-dd07e8e7-8255-4ea2-b9be-a44052607377-image.png" alt="dd07e8e7-8255-4ea2-b9be-a44052607377-image.png" class=" img-fluid img-markdown" /></p>
</li>
</ul>
<p dir="auto">Other than checking that I am not sure what else you can check.  Other than starting the process from scratch to re-install and re-auth I don’t know what else you can do.</p>
]]></description><link>https://forum.magicmirror.builders/post/101616</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101616</guid><dc:creator><![CDATA[mumblebaj]]></dc:creator><pubDate>Mon, 02 May 2022 13:04:11 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Mon, 02 May 2022 12:31:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mumblebaj" aria-label="Profile: mumblebaj">@<bdi>mumblebaj</bdi></a> Any ideas here? Would really like to get this functional. Appreciate any help!</p>
]]></description><link>https://forum.magicmirror.builders/post/101614</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101614</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Mon, 02 May 2022 12:31:14 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Sun, 01 May 2022 13:08:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mumblebaj" aria-label="Profile: mumblebaj">@<bdi>mumblebaj</bdi></a> Yes, I did:<br />
<img src="/assets/uploads/files/1651410499462-8a60dda2-8221-4bfd-98cf-052c31de2e72-image.png" alt="8a60dda2-8221-4bfd-98cf-052c31de2e72-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/101595</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101595</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Sun, 01 May 2022 13:08:32 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Sun, 01 May 2022 12:34:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mumblebaj" aria-label="Profile: mumblebaj">@<bdi>mumblebaj</bdi></a> he posted in discord<br />
<img src="/assets/uploads/files/1651408489474-unknown.png" alt="unknown.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/101592</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101592</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sun, 01 May 2022 12:34:51 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Sun, 01 May 2022 12:09:15 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> Did you add your client_id and client_secret to the config,js?</p>
<pre><code>{
                        module: "MMM-Strava",
                        header: "My STRAVA Stats",
                        position: "middle_center",
                        config: {
                                        client_id: "your_client_id",
                                        client_secret: "your_client_secret"
                                        activities: ["ride", "run", "swim"],
                                        period: "all",
                                        stats: ["count", "distance", "achievements"],
                                        units: "metric",
                                        updateInterval: 86400000,
                                        reloadInterval: 86400000
</code></pre>
<p dir="auto">I am using address: “0.0.0.0” and I am not having any issues.</p>
]]></description><link>https://forum.magicmirror.builders/post/101591</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101591</guid><dc:creator><![CDATA[mumblebaj]]></dc:creator><pubDate>Sun, 01 May 2022 12:09:15 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Sun, 01 May 2022 11:38:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> changed it<br />
<img src="/assets/uploads/files/1651405009943-b70d56bf-d220-4654-b02f-ad36643e0ecc-image.png" alt="b70d56bf-d220-4654-b02f-ad36643e0ecc-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">No luck though. I see lots of errors with Dev tools from PiHole module if I change from 0.0.0.0 to the IP of the RPI4</p>
<p dir="auto"><img src="/assets/uploads/files/1651405094620-8a822a9f-58fc-440b-ba25-0f7f62e8d7d0-image.png" alt="8a822a9f-58fc-440b-ba25-0f7f62e8d7d0-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.magicmirror.builders/post/101590</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101590</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Sun, 01 May 2022 11:38:46 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Sat, 30 Apr 2022 18:12:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a> if your MagicMirror config.js<br />
address:“0.0.0.0”</p>
<p dir="auto">change to the ip address of the pi</p>
<p dir="auto">address:“191.168.?.?”</p>
<p dir="auto">and try again</p>
]]></description><link>https://forum.magicmirror.builders/post/101581</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101581</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Sat, 30 Apr 2022 18:12:08 GMT</pubDate></item><item><title><![CDATA[Reply to MMM-Strava ID Unauthorized on Sat, 30 Apr 2022 18:08:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/berksmash1984" aria-label="Profile: BerkSmash1984">@<bdi>BerkSmash1984</bdi></a>  Opening developer tools shows the following at this point in the authorization:</p>
<p dir="auto"><img src="/assets/uploads/files/1651342093842-0603115f-0d2a-4902-bb77-41a0be3d9002-image.png" alt="0603115f-0d2a-4902-bb77-41a0be3d9002-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Note: I have my pihole disabled while testing, as it is also on this RPI</p>
]]></description><link>https://forum.magicmirror.builders/post/101580</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/101580</guid><dc:creator><![CDATA[BerkSmash1984]]></dc:creator><pubDate>Sat, 30 Apr 2022 18:08:39 GMT</pubDate></item></channel></rss>