Add Telldus Live! authentication example
This commit is contained in:
parent
f58793ca59
commit
6fa59e9ca9
4 changed files with 100 additions and 0 deletions
13
examples/php/live/authentication/getRequestToken.php
Normal file
13
examples/php/live/authentication/getRequestToken.php
Normal file
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once 'common.php';
|
||||
|
||||
$consumer = new HTTP_OAuth_Consumer(constant('PUBLIC_KEY'), constant('PRIVATE_KEY'));
|
||||
|
||||
$consumer->getRequestToken(constant('REQUEST_TOKEN'), constant('BASE_URL').'/getAccessToken.php');
|
||||
|
||||
$_SESSION['token'] = $consumer->getToken();
|
||||
$_SESSION['tokenSecret'] = $consumer->getTokenSecret();
|
||||
|
||||
$url = $consumer->getAuthorizeUrl(constant('AUTHORIZE_TOKEN'));
|
||||
header('Location:'.$url);
|
Loading…
Add table
Add a link
Reference in a new issue