2017 © Pedro Peláez
 

library identity-toolkit-php-client

Client library for Google Identity Toolkit APIs

image

google/identity-toolkit-php-client

Client library for Google Identity Toolkit APIs

  • Thursday, December 10, 2015
  • by cslink
  • Repository
  • 14 Watchers
  • 30 Stars
  • 14,813 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 22 Forks
  • 2 Open issues
  • 10 Versions
  • 5 % Grown

The README.md

Google Identity Toolkit client library for PHP

This is the PHP client library for Google Identity Toolkit services., (*1)

Example Code

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

$gitkitClient = Gitkit_Client::createFromFile("gitkit-server-config.json");

// ---- upload account -----
$hashKey = "\x01\x02\x03";
$gitkitClient->uploadUsers('HMAC_SHA1', $hashKey, createNewUsers($hashKey));

// --- verify gitkit token ----
$user = $gitkitClient->validateToken("eyJhb...");

// ---- get account info by user identifier ----
$user = $gitkitClient->getUserById("1234");

// ---- get a url to send to user's email address to verify ownership -----
$verificationLink = $gitkitClient->getEmailVerificationLink("1234@example.com");

// ---- download account ----
$iterator = $gitkitClient->getAllUsers(3);
while ($iterator->valid()) {
  $user = $iterator->current();
  // $user is a Gitkit_Account object
  $iterator->next();
}

// ---- delete account ----
$gitkitClient->deleteUser('1234');

function createNewUsers($hashKey) {
  $allUsers = array();

  $gitkitUser = new Gitkit_Account();
  $gitkitUser->setEmail("1234@example.com");
  $gitkitUser->setUserId("1234");
  $salt = "\05\06\07";
  $password = '1111';
  $gitkitUser->setSalt($salt);
  $gitkitUser->setPasswordHash(hash_hmac('sha1', $password . $salt, $hashKey, true));
  array_push($allUsers, $gitkitUser);

  $gitkitUser = new Gitkit_Account();
  $gitkitUser->setEmail('5678@example.com');
  $gitkitUser->setUserId('5678');
  $salt = "\15\16\17";
  $password = '5555';
  $gitkitUser->setSalt($salt);
  $gitkitUser->setPasswordHash(hash_hmac('sha1', $password . $salt, $hashKey, true));
  array_push($allUsers, $gitkitUser);

  return $allUsers;
}

The Versions

10/12 2015

dev-master

9999999-dev https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

10/12 2015

1.0.8

1.0.8.0 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

03/10 2015

1.0.7

1.0.7.0 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

29/09 2015

1.0.6

1.0.6.0 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

17/09 2015

1.0.5

1.0.5.0 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

15/08 2015

1.0.4

1.0.4.0 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

15/08 2015

dev-liujin-google-patch-1

dev-liujin-google-patch-1 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

17/06 2015

1.0.2

1.0.2.0 https://developers.google.com/identity-toolkit/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

23/02 2015

1.0.1

1.0.1.0 https://developers.google.com/identity-toolkit/v3/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit

09/10 2014

1.0.0

1.0.0.0 https://developers.google.com/identity-toolkit/v3/

Client library for Google Identity Toolkit APIs

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

gitkit