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
En esta página del sitio puede ver el video en línea PowerShell RestPS Tutorial #4 - Authentication de Duración hora minuto segunda en buena calidad , que subió el usuario JackedProgrammer 06 diciembre 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 2,356 veces y le gustó 34 a los espectadores. Disfruta viendo!