Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Authentication Parameter to Web Cmdlets for Basic and OAuth (#5052)
Closes #4274 Adds an -Authentication parameter to Invoke-RestMethod and Invoke-WebRequest Adds an -Token parameter to Invoke-RestMethod and Invoke-WebRequest Adds an -AllowUnencryptedAuthentication parameter to Invoke-RestMethod and Invoke-WebRequest Adds tests for various -Authorization uses -Authentication Parameter has 3 options: Basic, OAuth, and Bearer Basic requires -Credential and provides RFC-7617 Basic Authorization credentials to the remote server OAuth and Bearer require the -Token which is a SecureString containing the bearer token to send to the remote server If any authentication is provided for any transport scheme other than HTTPS, the request will result in an error. A user may use the -AllowUnencryptedAuthentication switch to bypass this behavior and send their secrets unencrypted at their own risk. -Authentication does not work with -UseDefaultCredentials and will result in an error. The existing behavior with -Credential is left untouched. When not supplying -Authentication, A user will not receive an error when using -Credential over unencrypted connections. Code design choice is meant to accommodate more Authentication types in the future. Documentation Needed The 3 new parameters will need to be added to the Invoke-RestMethod and Invoke-WebRequest documentation along with examples. Syntax will need to be updated.
- Loading branch information
1 parent
2cc0911
commit 7c9bddf
Showing
3 changed files
with
344 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.