2FA - IP Whitelisting and Public Keys
IP Whitelist
The IP of the system from which you make your request has to be whitelisted to connect with the Cashfree Payments production server. If the IP is not whitelisted, Cashfree Payments will reject all incoming requests.
To whitelist your IP,
- Go to Payouts Dashboard > Developers section on the left-side navigation > Payouts > Two-Factor Authentication > IP Whitelist.
- Click Add IP Address.
- Enter the IP Address you want to whitelist and save the details. All the IP’s you have whitelisted will be displayed as shown below. You can whitelist a maximum of 10 IPs.
Depending on your operating system, you can retrieve the IP of the system via
multiple methods. You can also find your IP using helper sites such as
https://whatismyipaddress.com/
Please note that the IPv4 has to be whitelisted, not IPv6.
Public Key
If you do not have a static IP, you can generate a public key and pass it with the API request.
To generate a public key,
- Go Payouts Dashboard > Developers section on the left-side navigation > Payouts > Two-Factor Authentication > Public Key.
- Click Generate Public Key. The public key will be downloaded to your computer and the password to access it will be your email ID registered with Cashfree Payments. Only one Public Key can be generated at a time.
Below are the steps to generate your signature:
- Retrieve your clientId (one which you are passing through the header X-Client-Id )
- Append this with CURRENT UNIX timestamp separated by a period (.)
- Encrypt this data using RSA encrypt with Public key you received – this is the signature.
- Pass this signature through the header X-Cf-Signature.
In the case of using our library, go through the libraries section. During the initialization process, you need to pass the key as a parameter.
Was this page helpful?