[GH-ISSUE #650] Token authentication doesn't work if default user credentials are defined in client.yml #481

Closed
opened 2026-05-05 04:06:25 -06:00 by gitea-mirror · 0 comments
Owner

Originally created by @Xinayder on GitHub (Mar 3, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/650

🐞 Describe the bug

Trying to use ntfy CLI with token authentication seems to fail if the client.yml settings file has default user credentials configured, i.e., the fields default-user and default-password are set.

💻 Components impacted

ntfy server

💡 Screenshots and/or logs

Setting client.yml with default-user: user and default-password: password:

$ ntfy pub -d --token=<redacted> https://notify.mydomain.com/teste testing message

2023/03/03 16:30:53 DEBUG notify.mydomain.com/teste Publishing message with headers map[Authorization:[Basic <redacted>]]
{"code":40101,"http":401,"error":"unauthorized","link":"https://ntfy.sh/docs/publish/#authentication"}

🔮 Additional context

$ ntfy token list

user user
- <redacted>, never expires, accessed from 0.0.0.0 at 03 Mar 23 16:29 UTC
Originally created by @Xinayder on GitHub (Mar 3, 2023). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/650 :lady_beetle: **Describe the bug** <!-- A clear and concise description of the problem. --> Trying to use ntfy CLI with token authentication seems to fail if the `client.yml` settings file has default user credentials configured, i.e., the fields `default-user` and `default-password` are set. :computer: **Components impacted** <!-- ntfy server, Android app, iOS app, web app --> ntfy server :bulb: **Screenshots and/or logs** <!-- If applicable, add screenshots or share logs help explain your problem. To get logs from the ... - ntfy server: Enable "log-level: trace" in your server.yml file - Android app: Go to "Settings" -> "Record logs", then eventually "Copy/upload logs" - web app: Press "F12" and find the "Console" window --> Setting `client.yml` with `default-user: user` and `default-password: password`: ``` $ ntfy pub -d --token=<redacted> https://notify.mydomain.com/teste testing message 2023/03/03 16:30:53 DEBUG notify.mydomain.com/teste Publishing message with headers map[Authorization:[Basic <redacted>]] {"code":40101,"http":401,"error":"unauthorized","link":"https://ntfy.sh/docs/publish/#authentication"} ``` :crystal_ball: **Additional context** <!-- Add any other context about the problem here. --> ``` $ ntfy token list user user - <redacted>, never expires, accessed from 0.0.0.0 at 03 Mar 23 16:29 UTC ```
gitea-mirror 2026-05-05 04:06:25 -06:00
  • closed this issue
  • added the
    🪲 bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/ntfy#481
No description provided.