I liked the following: ↷

Dropping Twitter Support on IndieAuth.com

<p>I've made the difficult decision to drop support for Twitter authentication on&nbsp;<a href="https://indieauth.com/">IndieAuth.com</a>. Some time last week, Twitter rolled out a change to the website which broke how IndieAuth.com verifies that a website and Twitter account belong to the same person.</p><br><br><img src="https://aaronparecki.com/2018/05/27/10/image-1.jpg" class="u-featured" alt=""><br><br><p>Since I am already in the process of replacing IndieAuth.com with two new websites (lots of discussion <a href="https://indieweb.org/IndieAuth#naming_confusion">on the wiki</a>), it is not worth the effort to do what it would take to fix this for IndieAuth.com.</p><br><h3>What Changed on Twitter.com</h3><br><p>In order to verify that you are the person behind the URL you initially type in, IndieAuth.com checks your website to find a link to a Twitter profile, then checks that Twitter profile to see if it links back to your website. If there is a match, then you'll see the green button for Twitter on IndieAuth.com.</p><br><p>Twitter rolled out a change that prevents normal HTTP requests from returning actual HTML on Twitter profiles. I'm assuming this is part of their effort to fight bots, but it's unfortunate this use case got caught up in that mess. If you visit your Twitter profile in a browser and click "view source", you'll see something like this now.</p><br><figure><br> <img src="https://aaronparecki.com/2018/05/27/10/image-2.png" alt=""><br></figure><br><p>This is a delightful bit of HTML that sets a cookie via Javascript and then reloads the page. Presumably this happens so quickly that normally you won't notice it.</p><br><p>Fetching a profile URL with curl now returns an empty HTTP body.</p><br><p>Even if I go through the hoops to make IndieAuth.com set cookies and refresh the page, there's no guarantee that they won't just change this again next week. I don't like playing these games, so instead I am just shutting off Twitter support in IndieAuth.com.</p><br><h3>Replacing IndieAuth.com</h3><br><p>The new version that you'll eventually use to sign in to the IndieWeb wiki is called <a href="https://indielogin.com/">IndieLogin.com</a>. It is currently in beta, and is not available to other developers, but you can try signing in to the test page there right now. This new version gets around this Twitter problem by not even attempting to fetch Twitter profile pages in the first place.</p><br><p>The new login flow works like this:</p><br><ul><br> <li><br> You enter your website on IndieLogin.com<br> <br><br> </li><br> <li>IndieLogin.com finds your Twitter profile by checking all rel=me links for one matching twitter.com</li><br> <li>IndieLogin.com shows you a button to authenticate with Twitter immediately (rather than first checking that your Twitter profile links back)</li><br> <li>After you authenticate on Twitter and are redirected back to IndieLogin.com, it fetches your Twitter profile from the Twitter API</li><br> <li>If your Twitter profile as reported by the API includes the initial website you started with, then you're authenticated</li><br></ul><br><p>This avoids the problem because IndieLogin.com never tries to fetch your Twitter profile HTML. Instead, it uses the API directly. This does mean that you can get into a situation where IndieLogin.com may prompt you with a Twitter button that can fail (if you are logged in to a different Twitter account than the one your website links to). However, it also speeds up the initial login prompt since it doesn't have to go check Twitter before showing you the login button first.</p><br><p>Hopefully I'll be able to launch IndieLogin.com soon so that the lack of Twitter support on IndieAuth.com isn't too annoying. In the mean time, you can authenticate via GitHub or email on IndieAuth.com.</p>
byAaron Parecki • posted archived copycurrent