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

Add a New Comment Rich Markup
   

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/docs/manpage.html#--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://example.com

Matt Blythe <mblythe>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-5190.
    Corresponding source code