Accessing Secret Server programmatically - Perl sample script

Root > Secret Server > API - Web Services

For instructions with using Perl and Integrated Windows Authentication see: http://support.thycotic.com/KB/a180/using-web-services-with-windows-authentication-perl.aspx

Secret Server Webservices can be called using scripts. This example demonstrates how to authenticate and retrieve a secret programatically in Perl. There is also a more detailed PHP example script.

This is a working example for Secret Server Online; a test user infromation has been filled in and OrganizationCode passed in. The test user has been restricted to only viewing Secrets.

If connecting to an Installed instance change the url to match your site and pass in empty string for organizationCode.

This example runs using standard perl libs with our exact version being Strawberry Perl 5.10.1.1.

Perl Sample Script
https://pastebin.com/AiwzX9n2

 

Feedback

Add Feedback
One trick if you get SSL errors from Perl when just using a local install without all the proper certs...

>>>
LWP::Protocol::https::Socket: SSL connect attempt failed with unknown errorerror
:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at
C:/strawberry/perl/vendor/lib/LWP/Protocol/http.pm line 51.LWP::Protocol::https::Socket: SSL connect attempt failed with unknown errorerror
:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed at
C:/strawberry/perl/vendor/lib/LWP/Protocol/http.pm line 51.
>>>

You can run "set PERL_LWP_SSL_VERIFY_HOSTNAME=0" from the cmd window before running your script. This will ignore the cert errors - definitely not recommended for production!

Jonathan (December 8 at 10:52 AM)

Add Feedback