本文整理汇总了PHP中OAuth::callbackURL方法的典型用法代码示例。如果您正苦于以下问题:PHP OAuth::callbackURL方法的具体用法?PHP OAuth::callbackURL怎么用?PHP OAuth::callbackURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OAuth
的用法示例。
在下文中一共展示了OAuth::callbackURL方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetSet
<?php
require_once 'system/config/constants.php';
require_once 'system/sys_lib/getset.php';
require_once 'system/includes/oauth/OAuth.class.php';
$getset = new GetSet();
//New OAuth with received request code
$oauth = new OAuth($getset->header("code"));
//URL to request auth token
$oauth->authURL('https://app.firmafon.dk/api/v2/token');
//URL for auth callback
$oauth->callbackURL(FIRMAFON_CALLBACK_URL);
//Client/App ID
$oauth->appID(APPLICATION_ID);
//App secret
$oauth->secret(APPLICATION_SECRET);
//Send auth request
if ($oauth->auth()) {
//print "Success!";
header("Location: index.php?load=Firmafon&token=" . $oauth->get_token());
} else {
//print "Nooo..!";
$oauth->message();
}
示例2: OAuth
<?php
require_once 'system/includes/oauth/OAuth.class.php';
//New OAuth with received request code
$oauth = new OAuth($getset->header("code"));
//URL to request auth token
$oauth->authURL('https://app.firmafon.dk/api/v2/token');
//URL for auth callback
$oauth->callbackURL("http://mudlogic.dk/Apps/Firmafon/auth.php");
//Client/App ID
$oauth->appID('26e6e84ff4cdf32055a6c31e7e81c9a2f47b322c5d3e31e3c81e2998277d724d');
//App secret
$oauth->secret('dba9353aa52b0343ff0260ac6a0766ec5b0d06f66c7605fc34a4f1c6a5853d83');
$request_mod = $sys_mods->get_Unassigned("Request");
//Send auth request
if ($oauth->auth()) {
//print "Success!";
$url = "load=" . $request_mod['id'] . "&token=" . $oauth->get_token();
print "<script type=\"text/javascript\">inget.view_LoadHREF('" . $url . "');</script>";
//header("Location: main.php?token=".$oauth->get_token());
} else {
//print "Nooo..!";
$oauth->message();
}