mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 08:26:00 +02:00
[GH-ISSUE #869] Documentation: Powershell send with token example #610
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#610
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jimholcomb on GitHub (Sep 6, 2023).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/869
In the doc for sending a message via PowerShell and using a token the doc uses this example:
When I run this with my URI and Token I get the error: "Cannot bind parameter 'Token'. Cannot convert the "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" value of type "System.String" to type "System.Security.SecureString"."
Changing the "Token =" line to below works for me:
Token = ConvertTo-SecureString -string "tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2" -AsPlainText -Force@jimholcomb commented on GitHub (Sep 7, 2023):
Also, Authorization = Bearer should be Authentication = Bearer
@binwiederhier commented on GitHub (Sep 7, 2023):
The actual header sent will be
Authorization: Bearer tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2, so I would have expected PowerShell to beAuthorization = "Bearer tk_AgQdq7mVBoFD37zQVN29RhuMzNIz2"like in the other PowerShell examples.Somebody else provided the PowerShell examples, so I can't really help.
Let me know what works and I will adjust the docs.
@jimholcomb commented on GitHub (Sep 7, 2023):
Per https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-restmethod?view=powershell-7.3 the parameter is Authentication.
Under the description of that parameter it says "Bearer: Requires the Token parameter. Sends an RFC 6750 Authorization: Bearer header with the supplied token." so the parameter is one thing (Authentication) but the header it sends is another (Authorization).
@binwiederhier commented on GitHub (Sep 10, 2023):
@jimholcomb Would you mind creating a PR for this, or providing a fully functioning example?
@binwiederhier commented on GitHub (Nov 18, 2023):
Closed due to inactivity.