2017 © Pedro Peláez
 

library php-session-helper

Diuit Session Token Helper, to make easier the session token creating process

image

diuitapi/php-session-helper

Diuit Session Token Helper, to make easier the session token creating process

  • Tuesday, March 8, 2016
  • by pofat
  • Repository
  • 3 Watchers
  • 1 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Diuit Session Token Helper

A simple PHP library to help you authenticate your devices from backend easier. It returns session token, which you have to pass to your device and login with it., (*1)

Installation

Package is available on Packagist, you can install it using Composer., (*2)

composer require diuitapi/php-session-helper

Dependencies

  • PHP 5.4+

Basic usage

Getting session token

Just use the DiuitTokenHelper to get a session token:, (*3)

use Diuit\DiuitTokenHelper;

$session = (new DiuitTokenHelper())->setAppId('your_app_id') // Configures app ID
                        ->setAppKey('your_app_key') // Configures app key
                        ->setKeyID('your_key_id') // Configures key id for finding public key
                        ->setPrivateKey('file://your_pem_file_path') // Configures private key (you can either use file path or plain text)
                        ->setUserSerial('user_serial') // Configures user serial
                        ->setExpDuration(7*24*3600) // Configures length of session valid duration (in seconds), example is in length of a week
                        ->getSessionToken('your_device_serial', 'gcm', 'device_push_token'); // Configures device serial, platform and push token(optional) and retrieves session token

echo $session; // will print session token

And then ... ?

Pass the session token you got here to your client (may be an app or browser), and login your client with it for using more features of Diuit Messaging API., (*4)

The Versions

08/03 2016

dev-master

9999999-dev https://github.com/diuitAPI/diuit.api.php-session-helper

Diuit Session Token Helper, to make easier the session token creating process

  Sources   Download

Apache-2.0

The Requires

 

by Pofat Tseng

jwt diuit

08/03 2016

0.1.3

0.1.3.0 https://github.com/diuitAPI/diuit.api.php-session-helper

Diuit Session Token Helper, to make easier the session token creating process

  Sources   Download

Apache-2.0

The Requires

 

by Pofat Tseng

jwt diuit

07/03 2016

0.1.2

0.1.2.0 https://github.com/diuitAPI/diuit.api.php-session-helper

Diuit Session Token Helper, to make easier the session token creating process

  Sources   Download

Apache-2.0

The Requires

 

by Pofat Tseng

jwt diuit