>>PHP Raindrop SDK
PHP Raindrop SDK2019-03-03T20:46:25+00:00

PHP Raindrop SDK

Raindrop PHP SDK Logo

Hydro Raindrop SDK PHP

This package provides a suite of convenience functions intended to simplify the integration of Hydro’s Raindrop authentication into your project. More information, including detailed API documentation, is available in the Raindrop documentation.

Raindrop comes in two flavors:

Client-side Raindrop

Client-side Raindrop is a next-gen 2FA solution. Hydro has open-sourced the code powering Client-side Raindrop.

Server-side Raindrop

Server-side Raindrop is an enterprise-level security protocol to secure APIs and other shared resources. Hydro has open-sourced the code powering Server-side Raindrop.

Installation instructions

composer require adrenth/raindrop-sdk

Usage example

require __DIR__ . '/../vendor/autoload.php';

$clientId = '...';
$clientSecret = '...';
$applicationId = '...';

$settings = new \Adrenth\Raindrop\ApiSettings(
    $clientId,
    $clientSecret,
    new \Adrenth\Raindrop\Environment\SandboxEnvironment
);

// Create token storage for storing the API's access token.
$tokenStorage = new \Adrenth\Raindrop\TokenStorage\FileTokenStorage(__DIR__ . '/token.txt');

// Ideally create your own TokenStorage adapter. 
// The shipped FileTokenStorage is purely an example of how to create your own.

/*
 * Client-side calls
 */
$client = new \Adrenth\Raindrop\Client($settings, $tokenStorage, $applicationId);

// (Un)register a user by it's Hydro ID
$client->registerUser($hydroId);
$client->unregisterUser($hydroId);

// Generate 6 digit message
$message = $client->generateMessage();

// Verify signature
$client->verifySignature($hydroId, $message);

/*
 * Server-side calls
 */
$server = new \Adrenth\Raindrop\Server($settings, $tokenStorage);

$server->whitelist('0x..'); // Provide ETH address
$server->challenge('41579b51-c365-406e-86a8-3839fcad576f');
$server->authenticate('41579b51-c365-406e-86a8-3839fcad576f');

Raindrop Hydro MFA plugin makes integration of Multi-Factor Authentication a breeze, Just install our plugin from here and follow the After Activation Process outlined below:

The following steps are necessary to enable Hydro Raindrop MFA on your site:

  • Create an account over at Hydrogen Website.
  • Apply for Production Access. Once approved, generate your Client IDClient Secret and Application ID.
  • In WordPress from the Main Menu navigate to Hydro Raindrop -> Settings -> API Settings and enter the above details, select Production Mode and the plugin is ready for use.
  • Set-up the preferred MFA method (and other customization options) in the tab Customization

That’s it!