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


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="darnahsan" data-post="9" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/darnahsan/48/17164_2.png" class="avatar"> darnahsan:</div>
<blockquote>
<aside class="quote no-group" data-username="Exadra37" data-post="6" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/exadra37/48/9183_2.png" class="avatar"> Exadra37:</div>
<blockquote>
<p>By the way being OWASP compliant is not enough to secure your APIs and if you want I can give you reading on it.</p>
</blockquote>
</aside>
<p>Please share the reading material for learning thanks.</p>
</blockquote>
</aside>
<p>In all answers I gave in <a href="https://stackoverflow.com/users/6454622/exadra37?tab=answers" rel="noopener nofollow ugc">StackOverflow</a> I normally end-up the answer with some links to the OWASP material:</p>
<blockquote>
<h2>Do You Want To Go The Extra Mile?</h2>
<p>In any response to a security question I always like to reference the excellent work from the OWASP foundation.</p>
<h3>For APIS</h3>
<p><a href="https://github.com/OWASP/API-Security" rel="noopener nofollow ugc">OWASP API Security Top 10</a></p>
<blockquote>
<p>The OWASP API Security Project seeks to provide value to software developers and security assessors by underscoring the potential risks in insecure APIs, and illustrating how these risks may be mitigated. In order to facilitate this goal, the OWASP API Security Project will create and maintain a Top 10 API Security Risks document, as well as a documentation portal for best practices when creating or assessing APIs.</p>
</blockquote>
<h3>For Mobile Apps</h3>
<p><a href="https://www.owasp.org/index.php/OWASP_Mobile_Security_Project#Top_Ten_Mobile_Risks" rel="noopener nofollow ugc">OWASP Mobile Security Project - Top 10 risks</a></p>
<blockquote>
<p>The OWASP Mobile Security Project is a centralized resource intended to give developers and security teams the resources they need to build and maintain secure mobile applications. Through the project, our goal is to classify mobile security risks and provide developmental controls to reduce their impact or likelihood of exploitation.</p>
</blockquote>
<p><a href="https://github.com/OWASP/owasp-mstg" rel="noopener nofollow ugc">OWASP - Mobile Security Testing Guide</a>:</p>
<blockquote>
<p>The Mobile Security Testing Guide (MSTG) is a comprehensive manual for mobile app security development, testing and reverse engineering.</p>
</blockquote>
<h3>For Web Apps</h3>
<p><a href="https://github.com/OWASP/wstg" rel="noopener nofollow ugc">The Web Security Testing Guide</a>:</p>
<blockquote>
<p>The OWASP Web Security Testing Guide includes a “best practice” penetration testing framework which users can implement in their own organizations and a “low level” penetration testing guide that describes techniques for testing most common web application and web service security issues.</p>
</blockquote>
</blockquote>
<p>Now, if your app takes in account all OWASP top ten risks you are only protecting it from being exploited through vulnerabilities, but you are not protecting it from being exploited through impersonation or if you prefer spoofed requests. My CEO makes these points in <a href="https://youtu.be/RSBhj60PsUU" rel="noopener nofollow ugc">this video</a> and <a href="https://blog.approov.io/securing-api-keys-for-robust-mobile-api-security" rel="noopener nofollow ugc">article</a> on the context of a mobile API, but the main points are still valid for any API. I need to do a disclaimer, the video contains a pitch to our product, but I think its still useful to better help you understand why it’s important that you go behind OWASP TOP 10 to  ensure that your API is not exploitable via spoofed requests, aka to identify that the request is indeed from <strong>what</strong> you expect, your original and untampered app.</p>
<p>You can also read more about protecting APIs in the several answers I gave in StackOverflow, like:</p>
<aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/61146427/secure-api-data-from-calls-out-of-the-app/61188785#61188785">
  <header class="source">

      <a href="https://stackoverflow.com/questions/61146427/secure-api-data-from-calls-out-of-the-app/61188785#61188785" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/6454622/exadra37" target="_blank" rel="noopener nofollow ugc">
    <img alt="Exadra37" src="https://i.sstatic.net/I8rOa.jpg?s=256" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/61146427/secure-api-data-from-calls-out-of-the-app/61188785#61188785" target="_blank" rel="noopener nofollow ugc">secure api data from calls out of the app</a>
</h4>

<div class="tags">
  <strong>rest, security, jwt, token</strong>
</div>

<div class="date">
  
  answered by
  <a href="https://stackoverflow.com/users/6454622/exadra37" target="_blank" rel="noopener nofollow ugc">
    Exadra37
  </a>
  on <a href="https://stackoverflow.com/questions/61146427/secure-api-data-from-calls-out-of-the-app/61188785#61188785" target="_blank" rel="noopener nofollow ugc">01:19PM - 13 Apr 20 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/61589028/prevent-untrusted-clients-to-use-login-register-endpoints-of-rest-api/61611403#61611403">
  <header class="source">

      <a href="https://stackoverflow.com/questions/61589028/prevent-untrusted-clients-to-use-login-register-endpoints-of-rest-api/61611403#61611403" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/6454622/exadra37" target="_blank" rel="noopener nofollow ugc">
    <img alt="Exadra37" src="https://i.sstatic.net/I8rOa.jpg?s=256" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/61589028/prevent-untrusted-clients-to-use-login-register-endpoints-of-rest-api/61611403#61611403" target="_blank" rel="noopener nofollow ugc">Prevent untrusted clients to use login/register endpoints of REST API</a>
</h4>

<div class="tags">
  <strong>rest, authentication, flutter, single-page-application</strong>
</div>

<div class="date">
  
  answered by
  <a href="https://stackoverflow.com/users/6454622/exadra37" target="_blank" rel="noopener nofollow ugc">
    Exadra37
  </a>
  on <a href="https://stackoverflow.com/questions/61589028/prevent-untrusted-clients-to-use-login-register-endpoints-of-rest-api/61611403#61611403" target="_blank" rel="noopener nofollow ugc">10:52AM - 05 May 20 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<aside class="onebox stackexchange" data-onebox-src="https://stackoverflow.com/questions/60559419/how-to-secure-an-api-rest-for-mobile-app-if-sniffing-requests-gives-you-the-k/60605789#60605789">
  <header class="source">

      <a href="https://stackoverflow.com/questions/60559419/how-to-secure-an-api-rest-for-mobile-app-if-sniffing-requests-gives-you-the-k/60605789#60605789" target="_blank" rel="noopener nofollow ugc">stackoverflow.com</a>
  </header>

  <article class="onebox-body">
      <a href="https://stackoverflow.com/users/6454622/exadra37" target="_blank" rel="noopener nofollow ugc">
    <img alt="Exadra37" src="https://i.sstatic.net/I8rOa.jpg?s=256" class="thumbnail onebox-avatar" width="256" height="256">
  </a>

<h4>
  <a href="https://stackoverflow.com/questions/60559419/how-to-secure-an-api-rest-for-mobile-app-if-sniffing-requests-gives-you-the-k/60605789#60605789" target="_blank" rel="noopener nofollow ugc">How to secure an API REST for mobile app? (if sniffing requests gives you the "key")</a>
</h4>

<div class="tags">
  <strong>java, rest, mobile, decompiling</strong>
</div>

<div class="date">
  
  answered by
  <a href="https://stackoverflow.com/users/6454622/exadra37" target="_blank" rel="noopener nofollow ugc">
    Exadra37
  </a>
  on <a href="https://stackoverflow.com/questions/60559419/how-to-secure-an-api-rest-for-mobile-app-if-sniffing-requests-gives-you-the-k/60605789#60605789" target="_blank" rel="noopener nofollow ugc">05:40PM - 09 Mar 20 UTC</a>
</div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>
 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202227" 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/what-are-authentication-options-for-phoenix-absinthe/37196/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-202227" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202227"
                     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="202228" data-post-id="202228">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group quote-modified" data-username="darnahsan" data-post="9" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/darnahsan/48/17164_2.png" class="avatar"> darnahsan:</div>
<blockquote>
<aside class="quote no-group" data-username="Exadra37" data-post="2" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/exadra37/48/9183_2.png" class="avatar"> Exadra37:</div>
<blockquote>
<p>I strongly advise you to build your web app in the traditional way, aka without using APIs,</p>
</blockquote>
</aside>
<p>SPA’s are also a bad idea then I suppose ? Similar to mobile they work with APIs</p>
</blockquote>
</aside>
<p>SPA’s it’s not the traditional way to build web apps, unless you never knew other way of doing it <img src="https://forum.elixirforum.com/images/emoji/apple/wink.png?v=15" title=":wink:" class="emoji" alt=":wink:" loading="lazy" width="20" height="20"></p>
<p>APIs are excellent way to make a business move forwarded quickly in this digital era, and in the web SPA’s are usually the way chosen to do it, but it comes at a very high price, because data is now more easily extracted  by Hackers, and the weekly news confirm that. Take for example the Open Banking API initiative to bring banks to the new era, it allows to build amazing decoupled products, but its costing a lot of money to the banks due to fraud they are not able to block from being committed through the APIs.</p>
<p>The point is, if your API is valuable for an attacker, be it financially or in terms of data, he will find the way to impersonate your genuine apps. Nowadays they don’t even try that hard to identify OWASP top 10 vulnerabilities to exploit, because often it’s more easy for them to observe how the app communicates with the backend and then build scripts to replicate the human behavior.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202228" 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/what-are-authentication-options-for-phoenix-absinthe/37196/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-202228" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202228"
                     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="202235" data-post-id="202235">
  <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>Okay but how is an official banking app (made by the same bank) supposed to communicate with the bank’s backend then?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202235" 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/what-are-authentication-options-for-phoenix-absinthe/37196/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-202235" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202235"
                     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="202237" data-post-id="202237">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="derek-zhou" data-post="11" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/derek-zhou/48/19943_2.png" class="avatar"> derek-zhou:</div>
<blockquote>
<p>you still can offload static asset serving to a CDN with liveview</p>
</blockquote>
</aside>
<p>Interested, could you elaborate on this ? What happens to templates?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202237" 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/what-are-authentication-options-for-phoenix-absinthe/37196/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-202237" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202237"
                     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="202238" data-post-id="202238">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I was talking about the images, css and js.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202238" 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/what-are-authentication-options-for-phoenix-absinthe/37196/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-202238" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202238"
                     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="202243" data-post-id="202243">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Exadra37" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Exadra37/120/9183_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Exadra37
                  </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="14" data-topic="37196" 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>Okay but how is an official banking app (made by the same bank) supposed to communicate with the bank’s backend then?</p>
</blockquote>
</aside>
<p>So, the main point of all this discussion is that you shouldn’t use an API for a web app just because you can. For mobile apps you almost don’t have other choice then going with the API, be it a REST API or a GraphQL one.</p>
<p>In the context of web-apps the old school ones are not using API’s and are tied up directly to their backend via the usual session cookies. While this ties up more the client to the server, specially when advanced fingerprint techniques are used, they still need to use User Behaviour Analytics in the backend, because the web app is still volatile to impersonation, just not so easy to achieve as when the web app is using APIs.</p>
<p>For mobile apps they usually use the traditionally APIs, with in house specs, but now they need to follow the Open Banking API specification. These API backends require even more advanced protections, because it’s extremely hard to differentiate <strong>what</strong> is doing the request.</p>
<p>If you want to feel how much easier is to impersonate an API vs a backend for a Web app, just try to figure out a webapp that doesn’t talk with an API, like easyjet(at least in the past wasn’t), and then try the same with one that uses an API, and you will see how usually it’s much easier to impersonate the one speaking the API idiom.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202243" 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/what-are-authentication-options-for-phoenix-absinthe/37196/17">Post #16</a>
	                </div>
	            </div>
              <div id="likers-container-202243" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202243"
                     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="202244" data-post-id="202244">
  <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="Exadra37" data-post="17" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/exadra37/48/9183_2.png" class="avatar"> Exadra37:</div>
<blockquote>
<p>So, the main point of all this discussion is that you shouldn’t use an API for a web app just because you can.</p>
</blockquote>
</aside>
<p>Ah. We agree on that. When it comes to web apps and when I am given the power to decide I’ll prefer to make server-side rendered app for both security and engineering reasons.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202244" 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/what-are-authentication-options-for-phoenix-absinthe/37196/18">Post #17</a>
	                </div>
	            </div>
              <div id="likers-container-202244" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202244"
                     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="202272" data-post-id="202272">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>We made a bunch of APIs with my team, exchanging JSON but using traditional login and sessien cookies. So it’s not actually REST but it is simple. Is that OK according to you <a class="mention" href="/u/exadra37" rel="nofollow">@Exadra37</a> ? I guess a mobile app could do the same. What is the difference between a cookie (traditional web app) and another header? I don’t get the difference, security-wise.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202272" 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/what-are-authentication-options-for-phoenix-absinthe/37196/19">Post #18</a>
	                </div>
	            </div>
              <div id="likers-container-202272" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202272"
                     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="202305" data-post-id="202305">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="lud" data-post="19" data-topic="37196">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/lud/48/14382_2.png" class="avatar"> lud:</div>
<blockquote>
<p>What is the difference between a cookie (traditional web app) and another header? I don’t get the difference, security-wise.</p>
</blockquote>
</aside>
<p>I recommend you to read the Mozilla guide:</p>
<aside class="onebox allowlistedgeneric" data-onebox-src="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies">
  <header class="source">
      <img src="https://developer.mozilla.org/favicon.ico" class="site-icon" alt="" width="48" height="48">

      <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies" target="_blank" rel="noopener nofollow ugc">MDN Web Docs</a>
  </header>

  <article class="onebox-body">
    <img width="690" height="690" src="https://developer.mozilla.org/mdn-social-image.46ac2375.png" class="thumbnail onebox-avatar" alt="">

<h3><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Cookies" target="_blank" rel="noopener nofollow ugc">Using HTTP cookies - HTTP | MDN</a></h3>

  <p>A cookie (also known as a web cookie or browser cookie) is a small piece of data a server sends to a user's web browser. The browser may store cookies, create new cookies, modify existing ones, and send them back to the same server with later...</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<blockquote>
<p>There are a couple of ways to ensure that cookies are sent securely and are not accessed by unintended parties or scripts: the <code>Secure</code> attribute and the <code>HttpOnly</code> attribute.</p>
</blockquote>
<p>The <code>httpOnly</code> flag is not the only one that should be in use, but some of the flags only have meaning when used in the context of a browser in order to prevent Javascript on that page to steal the cookies. Off-course you can always hit F12 and steel the cookie manually to use in a script, and thats why sites like banks and others used advanced fingerprint techniques within the cookie.</p>
<p>Other headers, like <code>api-key</code>, are so easy to extract by Javascript and reuse in another script and your API server will not be able to tell the difference regarding <strong>what</strong> is doing the request.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202305" 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/what-are-authentication-options-for-phoenix-absinthe/37196/20">Post #19</a>
	                </div>
	            </div>
              <div id="likers-container-202305" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202305"
                     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="202306" data-post-id="202306">
  <section>
    <div class="post-wrap">


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

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>This flag is enabled for our javascript SPAs, indeed, as the javascript app itself does not need to interact with the cookie. So what you mean in that a mobile app is not able to replicate this behaviour because it has to manage the cookie “manually”, unlinke apps running in browsers, thus it is easier to impersonate the “what” ?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="202306" 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/what-are-authentication-options-for-phoenix-absinthe/37196/21">Post #20</a>
	                </div>
	            </div>
              <div id="likers-container-202306" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="202306"
                     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/37196/load_more?page=3">Load more posts (8 remaining)</a>
</div></template></turbo-stream>