<?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[When trying to authorize http, the response is always &quot;status_code&quot;:401,&quot;status&quot;:&quot;Unauthorized&quot;]]></title><description><![CDATA[<p dir="auto">Hello assistant, I have developed an API for authorization using an http request. YcCaster and API are running in kubernetes on the same pod but in different containers. Config file looks like this:</p>
<pre><code>caster:
  host: yccaster-svil.good.cloud
  address: 0.0.0.0:2101
  identifier: My caster
  operator: My organization
  nmea: 1
  country: EST
  latitude: 59.44
  longitude: 24.74
  fallback_host: 0.0.0.0
  fallback_port: 0
  misc: Some notes
configuration:
  auth:
  - type: file
    options:
      mount-points: conf/mountpoints.yml
      clients: conf/clients.yml
  - type: http
    options:
      url: http://127.0.0.1:8888/yc-caster-api/mountpoints/ntrip_auth
      secret: super_secret
  api:
    host: yccaster-svil.good.cloud
    address: 0.0.0.0:8080
    api-keys:
      - "very_goood_key"
  events:
    - type: file
      options:
        path: /var/caster/session.log
        types:
          - caster-ready
          - caster-terminate
          - connection-accepted
          - connection-terminated
          - ntrip-request-accepted
          - ntrip-request-rejected
          - ntrip-session-started
          - ntrip-session-ended
license-key: ""
</code></pre>
<p dir="auto">when I try to connect the antenna, in the logs I get the response:</p>
<pre><code>{"name":"ntrip-request-rejected","timestamp":1689150511,"data":{"address":"130.211.2.114:51817","request":{"method":"SOURCE","password":"string","uri":"string","headers":[{"name
":"Source-Agent","value":"NTRIP RTKLIB/2.4.2"},{"name":"STR"}],"type":"server","ntrip_version":1,"connection_id":"dba2c3db-a31c-41e7-8fe1-81f2ea263847"},"response":{"-":"HTTP/1.
0","status_code":401,"status":"Unauthorized"},"connection_id":"dba2c3db-a31c-41e7-8fe1-81f2ea263847"}}
</code></pre>
<p dir="auto">this is very strange because when I request from the same container using "curl", I get the correct response with the code "200" and in the body "description" :</p>
<pre><code>root@yc-caster-885b96fcb-nd5rc:/var/caster# curl -X POST -vvv -H "Content-Type: application/json" -H "X-Api-Key: super_secret" -d '{"method":"SOURCE","password":"string","uri":"
string","http_version":"HTTP/1.0","headers":[{"name":"User-Agent","value":"NTRIP YCServer"}],"type":"server","ntrip_version":1
}' http://127.0.0.1:8888/yc-caster-api/mountpoints/ntrip_auth
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 127.0.0.1:8888...
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
&gt; POST /yc-caster-api/mountpoints/ntrip_auth HTTP/1.1
&gt; Host: 127.0.0.1:8888
&gt; User-Agent: curl/7.81.0
&gt; Accept: */*
&gt; Content-Type: application/json
&gt; X-Api-Key: super_secret
&gt; Content-Length: 174
&gt;
* Mark bundle as not supporting multiuse
&lt; HTTP/1.1 200 OK
&lt; Content-Type: application/json;charset=UTF-8
&lt; content-length: 331
&lt;
* Connection #0 to host 127.0.0.1 left intact
{"identifier":"string","format":"string","formatDetails":"string","carrier":"string","navSystem":"string","network":"string","country":"string","latitude":0.0,"longitude":0.0,"n
mea":"string","solution":"string","generator":"string","comprEncryp":"string","authentication":"string","fee":"string","bitrate":"string","misc":"string"}root@yc-caster-885b96fc
b-nd5rc:/var/caster#
</code></pre>
<p dir="auto">I can't figure out why the caster is getting "Unauthorized" when the request doesn't reach the API, any ideas how to solve this or how to debug it from the caster?</p>
]]></description><link>https://community.hedgehack.com/topic/24/when-trying-to-authorize-http-the-response-is-always-status_code-401-status-unauthorized</link><generator>RSS for Node</generator><lastBuildDate>Tue, 14 Apr 2026 02:42:26 GMT</lastBuildDate><atom:link href="https://community.hedgehack.com/topic/24.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 12 Jul 2023 08:54:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to When trying to authorize http, the response is always &quot;status_code&quot;:401,&quot;status&quot;:&quot;Unauthorized&quot; on Wed, 12 Jul 2023 13:07:33 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.hedgehack.com/uid/6">@ilyavialkov</a> I removed authentication through a file, but that didn't solve the problem:</p>
<pre><code>caster:
  host: yccaster-svil.sigemi.cloud
  address: 0.0.0.0:2101
  identifier: My caster
  operator: My organization
  nmea: 1
  country: EST
  latitude: 59.44
  longitude: 24.74
  fallback_host: 0.0.0.0
  fallback_port: 0
  misc: Some notes
configuration:
  auth:
  - type: http
    options:
      url: http://127.0.0.1:8888/yc-caster-api/mountpoints/ntrip_auth
      secret: super_secret
  api:
    host: yccaster-svil.sigemi.cloud
    address: 0.0.0.0:8080
    api-keys:
      - "104ebb67-a4bq-4c20-we36-99cb759d1ee9"
  events:
    - type: file
      options:
        path: /var/caster/session.log
        types:
          - caster-ready
          - caster-terminate
          - connection-accepted
          - connection-terminated
          - ntrip-request-accepted
          - ntrip-request-rejected
          - ntrip-session-started
          - ntrip-session-ended
license-key: ""
</code></pre>
<p dir="auto">and now in the logs there is no attempt to connect the source, only this:</p>
<pre><code>{"name":"caster-ready","timestamp":1689165626,"data":{"address":"[::]:2101","started_at":1689165626}}
</code></pre>
]]></description><link>https://community.hedgehack.com/post/78</link><guid isPermaLink="true">https://community.hedgehack.com/post/78</guid><dc:creator><![CDATA[dmytro.hryn]]></dc:creator><pubDate>Wed, 12 Jul 2023 13:07:33 GMT</pubDate></item><item><title><![CDATA[Reply to When trying to authorize http, the response is always &quot;status_code&quot;:401,&quot;status&quot;:&quot;Unauthorized&quot; on Wed, 12 Jul 2023 11:17:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.hedgehack.com/uid/46">@dmytro-hryn</a> said in <a href="/post/76">When trying to authorize http, the response is always "status_code":401,"status":"Unauthorized"</a>:</p>
<blockquote>
<p dir="auto">auth:</p>
<ul>
<li>type: file<br />
options:<br />
mount-points: conf/mountpoints.yml<br />
clients: conf/clients.yml</li>
<li>type: http<br />
options:<br />
url: <a href="http://127.0.0.1:8888/yc-caster-api/mountpoints/ntrip_auth" rel="nofollow ugc">http://127.0.0.1:8888/yc-caster-api/mountpoints/ntrip_auth</a><br />
secret: super_secret</li>
</ul>
</blockquote>
<p dir="auto">Remove file auth from config and keep only http.</p>
]]></description><link>https://community.hedgehack.com/post/77</link><guid isPermaLink="true">https://community.hedgehack.com/post/77</guid><dc:creator><![CDATA[ilyavialkov]]></dc:creator><pubDate>Wed, 12 Jul 2023 11:17:07 GMT</pubDate></item></channel></rss>