| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,15 @@ |
| 1 |
+<?php |
|
| 2 |
+require 'vendor/autoload.php'; |
|
| 3 |
+use Plivo\Util\AccessToken; |
|
| 4 |
+ |
|
| 5 |
+// using validFrom and lifetime |
|
| 6 |
+$acctkn = new AccessToken("{authId}", "{authToken}", "{endpointUsername}", gmdate('U'), 3600, null);
|
|
| 7 |
+// grants(incoming:false, outgoing:true) |
|
| 8 |
+$acctkn->addVoiceGrants(false, true); |
|
| 9 |
+echo $acctkn->toJwt() . "\n"; |
|
| 10 |
+ |
|
| 11 |
+// using validFrom and validTill, with custom uid |
|
| 12 |
+$acctkn = new AccessToken("{authId}", "{authToken}", "{endpointUsername}", gmdate('U'), null, gmdate('U', mktime(23, 59, 59, 4, 29, 2020)), "{uid}");
|
|
| 13 |
+// grants(incoming:true, outgoing:false) |
|
| 14 |
+$acctkn->addVoiceGrants(true, false); |
|
| 15 |
+echo $acctkn->toJwt() . "\n"; |
| 1 | 1 |
deleted file mode 100644 |
| ... | ... |
@@ -1,15 +0,0 @@ |
| 1 |
-<?php |
|
| 2 |
-require 'vendor/autoload.php'; |
|
| 3 |
-use Plivo\Util\AccessToken; |
|
| 4 |
- |
|
| 5 |
-// using validFrom and lifetime |
|
| 6 |
-$acctkn = new AccessToken("{authId}", "{authToken}", "{endpointUsername}", gmdate('U'), 3600, null);
|
|
| 7 |
-// grants(incoming:false, outgoing:true) |
|
| 8 |
-$acctkn->addVoiceGrants(false, true); |
|
| 9 |
-echo $acctkn->toJwt() . "\n"; |
|
| 10 |
- |
|
| 11 |
-// using validFrom and validTill, with custom uid |
|
| 12 |
-$acctkn = new AccessToken("{authId}", "{authToken}", "{endpointUsername}", gmdate('U'), null, gmdate('U', mktime(23, 59, 59, 4, 29, 2020)), "{uid}");
|
|
| 13 |
-// grants(incoming:true, outgoing:false) |
|
| 14 |
-$acctkn->addVoiceGrants(true, false); |
|
| 15 |
-echo $acctkn->toJwt() . "\n"; |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,15 @@ |
| 1 |
+<?php |
|
| 2 |
+require 'vendor/autoload.php'; |
|
| 3 |
+use Plivo\Util\AccessToken; |
|
| 4 |
+ |
|
| 5 |
+// using validFrom and lifetime |
|
| 6 |
+$acctkn = new AccessToken("{authId}", "{authToken}", "{endpointUsername}", gmdate('U'), 3600, null);
|
|
| 7 |
+// grants(incoming:false, outgoing:true) |
|
| 8 |
+$acctkn->addVoiceGrants(false, true); |
|
| 9 |
+echo $acctkn->toJwt() . "\n"; |
|
| 10 |
+ |
|
| 11 |
+// using validFrom and validTill, with custom uid |
|
| 12 |
+$acctkn = new AccessToken("{authId}", "{authToken}", "{endpointUsername}", gmdate('U'), null, gmdate('U', mktime(23, 59, 59, 4, 29, 2020)), "{uid}");
|
|
| 13 |
+// grants(incoming:true, outgoing:false) |
|
| 14 |
+$acctkn->addVoiceGrants(true, false); |
|
| 15 |
+echo $acctkn->toJwt() . "\n"; |