bugGNU Wget - Bugs: bug #64693, Add command line support for...

 
 

bug #64693: Add command line support for bearer token

Submitter:  Matt Blythe <mblythe>
Submitted:  Mon 18 Sep 2023 06:57:54 PM UTC
   
 
Category:  User Interface Severity:  3 - Normal
Priority:  5 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  None Operating System:  None
Reproducibility:  Every Time Fixed Release:  None
Planned Release:  None Regression:  No
Work Required:  None Patch Included:  No
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Sun 10 Mar 2024 09:57:59 AM UTC, comment #1: 

This would be a simple change and I would be happy to accept a patch :)

Darshit Shah <darnir>
Group administrator
Mon 18 Sep 2023 06:57:54 PM UTC, original submission:  

Currently, if a user wants to access an OAuth2 application, or any other URL that uses token-based authentication, they have to use this syntax:

wget --header "Authorization: Bearer <token>" <URL>

This is kind of clumsy.  It would be nicer if wget provided an option to provide just the token value, and it would take care of putting it in the HTTP header in the correct way.  For example:

wget --bearer-token <token> <URL>

There is already precedent for doing this: HTTP basic auth.  Instead of having users type

wget --header "Authorization: Basic <base64-encoded-username-password>"

Instead, wget allows the --user and --password options (or, the username & password in the URL?), and will create the appropriate HTTP header from that information.

I'll also note that curl has implemented a similar option (if wget wants to use the same option name for cross-compatibility):

From https://curl.se/d ... l#--oauth2-bearer

  --oauth2-bearer <token>

  (IMAP LDAP POP3 SMTP HTTP) Specify the Bearer Token for OAUTH 2.0 server authentication. The Bearer Token is used in conjunction with the user name which can be specified as part of the --url or -u, --user options.

  The Bearer Token and user name are formatted according to RFC 6750.

  If --oauth2-bearer is provided several times, the last set value is used.

  Example:

   curl --oauth2-bearer "mF_9.B5f-4.1JqM" https:// ... mple.com

Matt Blythe <mblythe>

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 4.0MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by darnir (Posted a comment)
  • -email is unavailable- added by mblythe (Submitted the item)
  •  

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16-11ef.
    Corresponding source code