Guest User

Untitled

a guest
Apr 24th, 2018
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. $username = "myemail@yahoo.it"
  2. $password = "myaccessKey"
  3. $url = "https://prsrl.od2.vtiger.com/webservice.php?operation=getchallenge&username=" + $username
  4. $challenge = Invoke-RestMethod $url
  5. $accessKey = $challenge.result.token + $password
  6. $md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider
  7. $ascii = new-object -TypeName System.Text.ASCIIEncoding
  8. $hash = [System.BitConverter]::ToString($md5.ComputeHash($ascii.GetBytes($accessKey)))
  9. $hash = $hash -replace '-', ''
  10. $body = @{operation='login'
  11. username=$username
  12. accessKey=$hash}
  13. $url = "https://prsrl.od2.vtiger.com/webservice.php"
  14. $login = Invoke-RestMethod -Body $body -Method POST -ContentType 'application/x-www-form-urlencoded' $url
  15. $login
Add Comment
Please, Sign In to add comment