title: How to get Authorization Bearer Token with curl or other unix tool
body: <p>I have a problem with getting Authorization Bearer Token value with unix tool like curl from site.
  The problem is that I don't know how to get only this value <strong>7FA733D2E75A962D1FED6D26989550BD</strong>. The value is different every time when i make a request (I mean it is not constant value).
  I have necessary information for this request and when i try with some browser with cookie manager and put by hand cookie value it is work and get valid token. 
  Cookie value is:</p>
  
  <pre><code>mac=00%3A1A%3A79%3A40%3A07%3AFF
  stb_lang=en
  timezone=Europe%2FParis
  </code></pre>
  
  <p>Request URL is:</p>
  
  <pre><code>http://livegopanel.club:8080/portal.php?type=stb&amp;action=handshake&amp;token=&amp;JsHttpRequest=1-xml
  </code></pre>
  
  <p>If I try to automate this job from linux console I am not able to get this token. 
  When I capture the tcp flow with wireshark get following information from process of getting valid token.</p>
  
  <p>This is the request to site:</p>
  
  <pre><code>GET /portal.php?type=stb&amp;action=handshake&amp;token=&amp;JsHttpRequest=1-xml HTTP/1.1
  Accept: */*
  User-Agent: Mozilla/5.0 (QtEmbedded; U; Linux; C) AppleWebKit/533.3 (KHTML, like Gecko) MAG200 stbapp ver: 4 rev: 2721 Mobile Safari/533.3
  Referer: http://livegopanel.club:8080/c/
  Accept-Language: en-US,*
  Accept-Charset: UTF-8,*;q=0.8
  X-User-Agent: Model: MAG254; Link: Ethernet
  Host: livegopanel.club:8080
  Cookie: mac=00%3A1A%3A79%3A40%3A07%3AFF; stb_lang=en; timezone=Europe%2FParis
  Connection: Keep-Alive
  </code></pre>
  
  <p>And this is the response from site:</p>
  
  <pre><code>HTTP/1.1 200 OK
  Date: Sat, 22 Feb 2020 09:22:53 GMT
  Content-Type: text/javascript;charset=UTF-8
  Transfer-Encoding: chunked
  Connection: keep-alive
  Set-Cookie: __cfduid=d538fd5b5e457f16e217ec8cf092ea2de1582363373; expires=Mon, 23-Mar-20 09:22:53 GMT; path=/; domain=.livegopanel.club; HttpOnly; SameSite=Lax
  Cache-Control: no-store, no-cache, must-revalidate
  Cache-Control: post-check=0, pre-check=0
  Pragma: no-cache
  CF-Cache-Status: DYNAMIC
  Server: cloudflare
  CF-RAY: 568fe5eebe337ea4-BUD
  
  {"js":{"token":"7FA733D2E75A962D1FED6D26989550BD"}}
  </code></pre>
  
  <p>I try many variation with curl but not able to get the value. How to build the curl request or have is other way (script written on bash, perl, etc.) to do this?</p>