本文整理汇总了PHP中OAuth\OAuth2\Service\AbstractService类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractService类的具体用法?PHP AbstractService怎么用?PHP AbstractService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractService类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkToken
/**
* Request access token
*
* This is the second step of oAuth authentication
*
* This implementation tries to abstract away differences between oAuth1 and oAuth2,
* but might need to be overwritten for specific services
*
* @return bool
*/
public function checkToken()
{
global $INPUT;
if (is_a($this->oAuth, 'OAuth\\OAuth2\\Service\\AbstractService')) {
/* oAuth2 handling */
if (!$INPUT->get->has('code')) {
return false;
}
$state = $INPUT->get->str('state', null);
try {
$this->oAuth->requestAccessToken($INPUT->get->str('code'), $state);
} catch (TokenResponseException $e) {
msg($e->getMessage(), -1);
return false;
}
} else {
/* oAuth1 handling */
if (!$INPUT->get->has('oauth_token')) {
return false;
}
$token = $this->storage->retrieveAccessToken($this->getServiceName());
// This was a callback request from BitBucket, get the token
try {
$this->oAuth->requestAccessToken($INPUT->get->str('oauth_token'), $INPUT->get->str('oauth_verifier'), $token->getRequestTokenSecret());
} catch (TokenResponseException $e) {
msg($e->getMessage(), -1);
return false;
}
}
return true;
}
开发者ID:ZeusWPI,项目名称:dokuwiki-plugin-oauth,代码行数:41,代码来源:AbstractAdapter.php
示例2: checkToken
/**
* Request access token
*
* This is the second step of oAuth authentication
*
* This implementation tries to abstract away differences between oAuth1 and oAuth2,
* but might need to be overwritten for specific services
*
* @return bool
*/
public function checkToken()
{
global $INPUT;
if (is_a($this->oAuth, 'OAuth\\OAuth2\\Service\\AbstractService')) {
/* oAuth2 handling */
if (!$INPUT->get->has('code')) {
return false;
}
$state = $INPUT->get->str('state', null);
try {
$this->oAuth->requestAccessToken($INPUT->get->str('code'), $state);
} catch (TokenResponseException $e) {
msg($e->getMessage(), -1);
return false;
}
} else {
/* oAuth1 handling */
if (!$INPUT->get->has('oauth_token')) {
return false;
}
$token = $this->storage->retrieveAccessToken($this->getServiceName());
// This was a callback request from BitBucket, get the token
try {
$this->oAuth->requestAccessToken($INPUT->get->str('oauth_token'), $INPUT->get->str('oauth_verifier'), $token->getRequestTokenSecret());
} catch (TokenResponseException $e) {
msg($e->getMessage(), -1);
return false;
}
}
$validDomains = $this->hlp->getValidDomains();
if (count($validDomains) > 0) {
$userData = $this->getUser();
if (!$this->hlp->checkMail($userData['mail'])) {
msg(sprintf($this->hlp->getLang("rejectedEMail"), join(', ', $validDomains)), -1);
send_redirect(wl('', array('do' => 'login'), false, '&'));
}
}
return true;
}
开发者ID:supergravity-org,项目名称:dokuwiki-plugin-oauth,代码行数:49,代码来源:AbstractAdapter.php
示例3: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, true);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('https://oauth.reddit.com');
}
}
开发者ID:DevSlashNull,项目名称:PHPoAuthLib,代码行数:7,代码来源:Reddit.php
示例4: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null, $apiVersion = "v3")
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, true, $apiVersion);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('https://api.twitch.tv/kraken/');
}
}
开发者ID:freaktechnik,项目名称:PHPoAuthLib,代码行数:7,代码来源:Twitch.php
示例5: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if ($baseApiUri === null) {
$this->baseApiUri = new Uri(self::API_URI_US);
}
}
开发者ID:RewardGateway,项目名称:PHPoAuthLib,代码行数:7,代码来源:BattleNet.php
示例6: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if ($baseApiUri === null) {
$this->baseApiUri = new Uri('https://getpocket.com/v3/');
}
}
开发者ID:DevSlashNull,项目名称:PHPoAuthLib,代码行数:7,代码来源:Pocket.php
示例7: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('http://rest.bullhornstaffing.com/rest-services/');
}
}
开发者ID:davenorthcreek,项目名称:stratum,代码行数:7,代码来源:BullhornService.php
示例8: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null, $apiVersion = "")
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, false, $apiVersion);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('http://server.oauth2.nukeviet.vn/oauth2/resource');
}
}
开发者ID:vuthao,项目名称:nukeviet-oauth2,代码行数:7,代码来源:NukeViet.php
示例9: __construct
public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri(static::BASE_URL . 'resource/');
}
}
开发者ID:paliari,项目名称:oauth2-client-facade,代码行数:7,代码来源:IsseHom.php
示例10: __construct
public function __construct(\OAuth\Common\Consumer\CredentialsInterface $credentials, \OAuth\Common\Http\Client\ClientInterface $httpClient, \OAuth\Common\Storage\TokenStorageInterface $storage, $scopes = array(), \OAuth\Common\Http\Uri\UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('https://www.readability.com/api/rest/v1/');
}
}
开发者ID:Type-of-Read,项目名称:Readability-API-1,代码行数:7,代码来源:Request.php
示例11: request
/**
* {@inheritdoc}
*/
public function request($path, $method = 'GET', $body = null, array $extraHeaders = array())
{
if (is_null($this->baseApiUri)) {
$this->setBaseApiUri($this->storage->retrieveAccessToken($this->service()));
}
return parent::request($path, $method, $body, $extraHeaders);
}
开发者ID:vladvoth,项目名称:productclash,代码行数:10,代码来源:Mailchimp.php
示例12: __construct
public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('https://api.paypal.com/v1/');
}
}
开发者ID:Tarendai,项目名称:spring-website,代码行数:7,代码来源:Paypal.php
示例13: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = [], UriInterface $baseApiUri = null, $apiVersion = "")
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, false, $apiVersion);
$this->apiVersion = "v1";
if (is_null($baseApiUri)) {
$this->baseApiUri = new Uri(self::API_URL . $this->getApiVersionString());
}
}
开发者ID:artis-mosties,项目名称:oauth-php,代码行数:8,代码来源:Pinterest.php
示例14: __construct
public function __construct(Credentials $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
$scopes = array();
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('https://sisilogin.testeveonline.com/oauth/');
}
}
开发者ID:bastianh,项目名称:phpbb-ext-evesso,代码行数:8,代码来源:oauth_oauth2_evesso.php
示例15: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
$hlp = plugin_load('helper', 'oauth');
$this->domain = $hlp->getConf('auth0-domain');
if (null === $baseApiUri) {
$this->baseApiUri = new Uri("https://{$this->domain}/");
}
}
开发者ID:araname,项目名称:dokuwiki-plugin-oauth,代码行数:9,代码来源:Auth0.php
示例16: __construct
public function __construct(CredentialsInterface $credentials, ClientInterface $httpClient, TokenStorageInterface $storage, $scopes = array(), UriInterface $baseApiUri = null)
{
if (empty($scopes)) {
$scopes = array(self::SCOPE_PUBLIC);
}
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri, true);
if (null === $baseApiUri) {
$this->baseApiUri = new Uri('https://www.strava.com/api/v3/');
}
}
开发者ID:clee03,项目名称:metal,代码行数:10,代码来源:Strava.php
示例17: getAuthorizationMethod
/**
* Returns a class constant from ServiceInterface defining the authorization method used for the API
* Header is the sane default.
*
* @return int
*/
protected function getAuthorizationMethod()
{
switch ($this->authorizationMethod) {
case 'querystring':
return static::AUTHORIZATION_METHOD_QUERY_STRING;
case 'querystring2':
return static::AUTHORIZATION_METHOD_QUERY_STRING_V2;
case 'bearer':
return static::AUTHORIZATION_METHOD_HEADER_BEARER;
}
return parent::getAuthorizationMethod();
}
开发者ID:Flesh192,项目名称:magento,代码行数:18,代码来源:Mock.php
示例18: request
/**
* {@inheritdoc}
*/
public function request($path, $method = 'GET', $body = null, array $extraHeaders = array())
{
$uri = $this->determineRequestUriFromPath($path, $this->baseApiUri);
$uri->addToQuery('v', $this->apiVersionDate);
return parent::request($uri, $method, $body, $extraHeaders);
}
开发者ID:DevSlashNull,项目名称:PHPoAuthLib,代码行数:9,代码来源:Foursquare.php
示例19: request
public function request($path, $method = 'GET', $body = null, array $extraHeaders = array())
{
$params = ['oauth_token' => 'qyprd3VVTi05a8Ukbv2DNO2Z2CP1CwflHHrGUiAOyPMQ1CTB', 'oauth_nonce' => $this->_nonce(), 'oauth_consumer_key' => $this->credentials->getConsumerId(), 'oauth_signature_method' => 'HMAC-SHA1', 'oauth_timestamp' => time(), 'oauth_version' => '1.0'];
$responseBody = $this->httpClient->retrieveResponse(new Uri(\Config::get('intuit.url') . $path), $params, $extraHeaders);
dd($responseBody);
array_walk($params, function (&$val, &$key) {
$key = strtolower($key);
$val = strtolower($key) . '=' . $val;
});
return parent::request($path, $method, $body, $extraHeaders);
}
开发者ID:raycho,项目名称:PHPoAuthLib,代码行数:11,代码来源:Intuit.php
示例20: request
/**
* {@inheritdoc}
*/
public function request($path, $method = 'GET', $body = null, array $extraHeaders = array())
{
$uri = new Uri($this->baseApiUri . $path);
$uri->addToQuery('v', $this->apiVersionDate);
return parent::request($uri, $method, $body, $extraHeaders);
}
开发者ID:shabbirvividads,项目名称:magento2,代码行数:9,代码来源:Foursquare.php
注:本文中的OAuth\OAuth2\Service\AbstractService类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论