Giter VIP home page Giter VIP logo

wowza-token-auth-generator-php's Introduction

#Token generator for Wowza Token Authentication

INITIALIZE

require_once 'TokenAuthGenerator.php';
$token = new TokenAuthGenerator();

SET KEY

$token->setKey('jJD7DJ0jd8d19');

SET EXPIRATION TIME (optional)

$token->setExpire(1333497600);

SET ALLOW DOMAIN (optional)

$token->setRefAllow(array('domain1.com', 'domain2.com'));

SET DENY DOMAIN (optional)

$token->setRefDeny(array('domain.com', 'MISSING'));

ECHO TOKEN

echo $token->toString();

SAMPLE OUTPUT

5351d09e9cdc30cc498703245849ccdc11970c4a328faa77fc75dac3fafef0783e31f9d1d012d4f9dd2fd2659b194a2953d2ad22d8a94014887ca52bd

Then append the result to the end of the streaming CDN URL as in the following example:

rtmp://12345.r.cdnsun.net/_definst_/live?token=5351d09e9cdc30cc498703245849ccdc11970c4a328faa77fc75dac3fafef0783e31f9d1d012d4f9dd2fd2659b194a2953d2ad22d8a94014887ca52bd

METHOD PARAMETERS

  • setExpire(integer)

    • Number of seconds since Unix time (Epoch time)
    • UTC based
    • Must not be earlier than current time
  • setRefAllow(array)

  • Referrer domain(s) (e.g. domain.com) or path (e.g. domain.com/video/)

  • Wildcard (*) allowed only at the beginning of a referrer, e.g. *.domain.com

  • Do not append space at the start & end of a referrer

  • Domain must fullfill RFC 3490

  • Path must fullfill RFC 2396

  • Should not include port (e.g. domain.com:3000/video)

  • Should not include protocol portion (e.g. http://domain.com)

  • setRefDeny(array)

    • Same rules as in setRefAllow()
    • Normally setRefAllow() & setRefDeny() are not to be used together, but if this happened setRefAllow() will take precedence over setRefDeny().

ALLOW BLANK / MISSING REFERRER

Both "SetRefAllow()" & "setRefDeny()" could be configured to allow/deny blank or missing referrer during Token Auth validation.

wowza-token-auth-generator-php's People

Contributors

cdnsun-david avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.