Basic authentication code samples
-
- UpdatedJan 30, 2025
- 2 minutes to read
- Yokohama
- API implementation
Samples of basic authentication code for several programming languages and versions.
Perl and the SOAP::Lite libraries
To supply basic authentication when using Perl and the SOAP::Lite libraries, you can implement the following function:
C# .NET VS 2005 or older
When using C# .NET VS 2005 or older, you can take advantage of the Credentials object. For example:
C# .NET VS 2008
When using C# .NET VS 2008, you can take advantage of the ClientCredentials object. For example:
Then in your app.config file look for the following and change "None" to "Basic":
VB .NET
When using VB .NET taking advantage of the Credentials object would look like the following:
The resulting response when Basic Authentication is turned on and no credentials are supplied looks like this: