Skip to content

Files

Latest commit

 

History

History

php

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Phenix EdgeAuth Digest Tokens for PHP

Easily generate secure digest tokens to use with the Phenix platform without requiring any networking activity.

Installation

To install Phenix Edge Authorization Digest Token with composer:

$ composer install

Run the Tests

To run the unit tests with composer:

$ composer run test

PHP Example

<?php

namespace EdgeAuthExample;

use EdgeAuth\TokenBuilder;

class Example
{
    function __construct()
    {
        $theToken = (new TokenBuilder())
            ->withApplicationId('test')
            ->withSecret('abc')
            ->expiresInSeconds(300);
        $result = $theToken->build();
    }
}

Command Line Examples

Display the help information:

./bin/edgeAuth --help

Create a token for channel access:

./bin/edgeAuth --applicationId "my-application-id" --secret "my-secret" --expiresInSeconds 3600 --channel "us-northeast#my-application-id#my-channel.1345"

To include Phenix EdgeAuth in your PHP project

Add these entries to your composer.json:

{
    .
    .
    .
    "require": {
        "phenixrts/edgeauth": "1.2.5"
    }
    .
    .
    .
    "repositories": [{
        "type": "package",
        "package": {
          "name": "phenixrts/edgeauth",
          "type": "zip",
          "version": "1.2.5",
          "dist": {
            "type": "zip",
            "url": "https://github.com/PhenixRTS/EdgeAuth/releases/download/php%401.2.4/php@1.2.5.zip"
          }
        }
    }]
    .
    .
    .
}