In this video I go over how to add basic authentication to your REST PS deployment and add a SSL certificate to it as well to be able to use the API over https.
Encoding password :
[Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes("PasswordHere"))
Bypass self signed SSL Cert :
add-type -TypeDefinition @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
Tags:
Rest api,api,powershell,jackedprogrammer,programming,coding,scripting,restful,setup, tutorial, powershell restps, restps, https, ssl, authentication
On this page of the site you can watch the video online PowerShell RestPS Tutorial #4 - Authentication with a duration of hours minute second in good quality, which was uploaded by the user JackedProgrammer 06 December 2021, share the link with friends and acquaintances, this video has already been watched 2,356 times on youtube and it was liked by 34 viewers. Enjoy your viewing!