Authentication & Security¶
CibPay SDK uses certificate-based authentication combined with basic HTTP authentication.
Certificate Setup¶
- Get Certificate: Contact CibPay to receive your
.p12
certificate file and password - Place in Project: Add certificate to
Certificate/
folder - Configure Project: Set certificate to copy to output directory
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<None Update="Certificate\api-cibpay.p12">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Authentication Configuration¶
var options = new SdkOptions
{
Username = "your-username",
Password = "your-password",
CertificatePath = "Certificate/api-cibpay.p12",
CertificatePassword = "your-certificate-password",
BaseUrl = "https://api-preprod.cibpay.co"
};
var client = CibPayClientFactory.Create(options);
Security Best Practices¶
- Never hardcode credentials in source code
- Use environment variables for sensitive data
- Store certificates securely in production
- Monitor certificate expiration dates
- Use HTTPS URLs only
Common Issues¶
Issue | Solution |
---|---|
Certificate file not found | Check file path and CopyToOutputDirectory setting |
Authentication failed | Verify username, password, and certificate password |
Certificate expired | Contact CibPay for renewed certificate |