<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="259101" data-post-id="259101">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>It’s a good start, I always hated working with it and it always felt like a half-solution, 99% because of the reasons you and <a class="mention" href="/u/hauleth" rel="nofollow">@hauleth</a> already enumerated above. It mostly just added complexity and extra code for not much added security (if any at all).</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259101" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-259101" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259101"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="259102" data-post-id="259102">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Pistrie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Pistrie/120/32067_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Pistrie
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>So what <em>should</em> I use if I want to have authentication/authorization for my API? What I’m really looking for is a step-by-step tutorial that I can follow, as I’m still learning Elixir and Phoenix, and these types of guides work really well for me.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259102" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-259102" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259102"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="259104" data-post-id="259104">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dorgan" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dorgan/120/22107_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dorgan
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>What’s the intended use case though?</p>
<p>In this thread it’s kind of assumed that this is for a website, and in such case why not just leverage old-fashioned http-only cookie based authentication? Phoenix by default even provides auth generators and CSRF protection so you don’t have to deal with any of the tedious bits. The fact that your endpoints return JSON instead of an html document does not magically make it require some special authentication strategy, so why bother?</p>
<p>Now if the API is either:<br>
A- Intended to be consumed by a first-party client like a mobile app<br>
B- Intended to be consumed by third parties</p>
<p>Then yeah it makes sense to discuss this.</p>
<p>For A, cookies are just regular http headers so you can also leverage them for your first-party mobile client, there’s almost no need to deal with a different strategy here.</p>
<p>For B, there’s stuff like OAuth2, this is the use case where the stateless tokens, refresh tokens and all that dance makes the most sense, and how to store these tokens is the problem of the third party, not yours.</p>
<p>I might be missing something important though, but really just because you return JSON doesn’t mean you have to think of a complete different authentication strategy, it’s more about who’s the party that will consume that and still assume malicious third parties are trying to own your base.</p>
<p>Maybe <a class="mention" href="/u/exadra37" rel="nofollow">@Exadra37</a> has some insights on this, if he doesn’t mind the ping <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259104" data-batch-url="/posts/batch_likers">
                        8
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-259104" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259104"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="259107" data-post-id="259107">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Pistrie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Pistrie/120/32067_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Pistrie
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>There isn’t any use case, I just want to learn how to create Elixir/Phoenix APIs as my only current experience is Express.js with a bit of basic JWT. The idea I like the most is for it to be an API available to the public, meaning that anyone should be able to create a front-end for it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259107" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-259107" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259107"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="259108" data-post-id="259108">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="al2o3cr" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/al2o3cr/120/3457_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  al2o3cr
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>The <a href="https://www.rfc-editor.org/rfc/rfc6749.html#section-6" rel="nofollow">refresh token flow</a> to exchange a refresh token for a new access token normally requires client credentials in the <code>Authorization</code> header, just like the second step of the <a href="https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.3" rel="nofollow">authorization code flow</a> where the authorization code is exchanged for an access token.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259108" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-259108" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259108"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #15"></div>
  </section>
</div>
    <div class="postbit" id="259122" data-post-id="259122">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="trisolaran" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/trisolaran/120/23748_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  trisolaran
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="12" data-topic="49702" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>It’s a good start, I always hated working with it and it always felt like a half-solution, 99% because of the reasons you and <a class="mention" href="/u/hauleth" rel="nofollow">@hauleth</a> already enumerated above. It mostly just added complexity and extra code for not much added security (if any at all).</p>
</blockquote>
</aside>
<p>I was joking <img src="https://forum.elixirforum.com/images/emoji/apple/slight_smile.png?v=15" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>
<p>Not an expert, but:</p>
<p>I have nothing against JWT a priori, I don’t think it’s “dumb” to use them. I think their advantage is simplicity. They’re simpler than creating, storing and managing tokens in your DB: you just sign the token, send it to the client and you’re done. But you pay of course for it in weakened security (number one problem IMO: can’t revoke them).</p>
<p>If you’re building an API for HTTP-only clients then I guess there’s nothing against using an HTTP-only cookies for API authentication, it’s certainly better protection against XSS, as explained by <a class="mention" href="/u/hauleth" rel="nofollow">@hauleth</a>. But it’s not 100% protection: if I mount a successful XSS attack against your site I can’t read your HTTP-only cookie, but I can send requests to your site and your browser will send the cookie along, thus allowing me to impersonate you and do all sorts of bad things. Successful XSS attacks are pretty much a “game over” scenario IMO.</p>
<aside class="quote no-group" data-username="Pistrie" data-post="13" data-topic="49702" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pistrie/48/32067_2.png" class="avatar"> Pistrie:</div>
<blockquote>
<p>So what <em>should</em> I use if I want to have authentication/authorization for my API? What I’m really looking for is a step-by-step tutorial that I can follow, as I’m still learning Elixir and Phoenix, and these types of guides work really well for me.</p>
</blockquote>
</aside>
<p>If you just want to learn how to build authentication for Phoenix APIs then you might check out tutorials like <a href="https://blog.kalvad.com/handle-authentication-with-phoenix-framework/" rel="noopener nofollow ugc">this one</a>. Seems pretty simple. It uses Guardian (which uses JWT), but if it’s just for learning how to build a simple API, I don’t see any issue with it. You can extend your API to use more bullet-proof security later.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259122" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-259122" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259122"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #16"></div>
  </section>
</div>
    <div class="postbit" id="259132" data-post-id="259132">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Pistrie" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Pistrie/120/32067_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Pistrie
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Thanks for that extra tutorial. Do you perhaps have any pointers on the bullet-proof, or at least more secure ways of authenticating? Phoenix.Token gets mentioned, as well as oauth, but I’m completely at a loss because it seems like there’s a dozen different ways to go about it.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259132" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-259132" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259132"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #17"></div>
  </section>
</div>
    <div class="postbit" id="259146" data-post-id="259146">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="dimitarvp" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/120/38664_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  dimitarvp
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="trisolaran" data-post="17" data-topic="49702">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/trisolaran/48/23748_2.png" class="avatar"> trisolaran:</div>
<blockquote>
<p>(number one problem IMO: can’t revoke them).</p>
</blockquote>
</aside>
<p>But that’s a complete deal breaker! To me every security has to start with “the server can pull your plug at any moment”. That’s how you do security in depth: you accept the possibility that a password or a token can be stolen but you also make sure they can be made null and void at the press of a button.</p>
<aside class="quote no-group" data-username="trisolaran" data-post="17" data-topic="49702">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/trisolaran/48/23748_2.png" class="avatar"> trisolaran:</div>
<blockquote>
<p>Successful XSS attacks are pretty much a “game over” scenario IMO.</p>
</blockquote>
</aside>
<p>I agree but there’s nothing we can do as programmers. Those holes are for browser vendors to fix. <img src="https://forum.elixirforum.com/images/emoji/apple/person_shrugging.png?v=15" title=":person_shrugging:" class="emoji" alt=":person_shrugging:" loading="lazy" width="20" height="20"> What we can do is follow best practices and keep up with modern developments.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259146" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-259146" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259146"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #18"></div>
  </section>
</div>
    <div class="postbit" id="259151" data-post-id="259151">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="trisolaran" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/trisolaran/120/23748_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  trisolaran
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Good discussion!</p>
<aside class="quote no-group" data-username="dimitarvp" data-post="19" data-topic="49702">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>But that’s a complete deal breaker! To me every security has to start with “the server can pull your plug at any moment”.</p>
</blockquote>
</aside>
<p>Ok, but then you must know that a lot of security defaults are below your expectations. A default Phoenix app stores its session <a href="https://github.com/phoenixframework/phoenix/blob/730bb6f86c27e731675a12cb962ae5accf551bcf/installer/templates/phx_web/endpoint.ex#L8" rel="noopener nofollow ugc">in the cookie</a>. You can’t “pull the plug” on that from the server side, if I have that cookie I can use it until it expires. Same is true for <a href="https://hexdocs.pm/phoenix/Phoenix.Token.html" rel="noopener nofollow ugc">phoenix tokens</a>.</p>
<p>If you want to pull the plug from the server whenever you want against a malicious client, then you must store cookies or tokens  in your backend and check them with every request. Too much overhead? That’s where refresh tokens (which have been hastily shot down above) might help: you can store and verify only the refresh token and keep the access token stateless and short-lived. In this way you can “pull the plug” on the refresh token and as soon as the access token expires and cannot be refreshed, the user is logged out.</p>
<p>It’s all about trade-offs really IMO, complexity/overhead vs security.</p>
<aside class="quote no-group" data-username="Pistrie" data-post="18" data-topic="49702" data-full="true">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/pistrie/48/32067_2.png" class="avatar"> Pistrie:</div>
<blockquote>
<p>Thanks for that extra tutorial. Do you perhaps have any pointers on the bullet-proof, or at least more secure ways of authenticating? Phoenix.Token gets mentioned, as well as oauth, but I’m completely at a loss because it seems like there’s a dozen different ways to go about it.</p>
</blockquote>
</aside>
<p>phoenix tokens may be cryptographically more secure than JWT, but you still can’t revoke them. It really depends on what kind of security you want for your API. As I said, if you’re just learning how to write an API my suggestion is to pick something simple.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259151" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-259151" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259151"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #19"></div>
  </section>
</div>
    <div class="postbit" id="259160" data-post-id="259160">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="LostKobrakai" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/LostKobrakai/120/3072_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  LostKobrakai
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="dimitarvp" data-post="19" data-topic="49702">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/48/38664_2.png" class="avatar"> dimitarvp:</div>
<blockquote>
<p>But that’s a complete deal breaker! To me every security has to start with “the server can pull your plug at any moment”.</p>
</blockquote>
</aside>
<p>“The server can pull the plug at any moment” might be a requirement or might just as well not be. There’s certainly contexts where the latter is the case – not everything involves access to not to be leaked data – and in the end it’s less of a technical decision than one of risk over benefit taken by the business. But as always this requires awareness of the risks involved and the business value gained by taking or not taking them.</p>
<p>Generally I’d still suggest keeping things simple, use db driven auth/static tokens, have http only sessions where useful. If there’s business value to be had from using less secure (mostly less central-db heavy) options then there’s money for changing out a previous implementation as well.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="259160" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/do-refresh-tokens-provide-a-false-sense-of-security/49702/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-259160" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="259160"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #20"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/49702/load_more?page=3">Load more posts (28 remaining)</a>
</div></template></turbo-stream>