unitedworldwrestling/oauth2-athena 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

unitedworldwrestling/oauth2-athena

最新稳定版本:1.0.2

Composer 安装命令:

composer require unitedworldwrestling/oauth2-athena

包简介

Athena OAuth 2.0 Client Provider for The PHP League OAuth2-Client

README 文档

README

This package provides Athena OAuth 2.0 support for the PHP League's OAuth 2.0 Client.

Installation

To install, use composer:

composer require unitedworldwrestling/oauth2-athena

Usage

Usage is the same as The League's OAuth client, using \Unitedworldwrestling\OAuth2\Client\Provider\Athena as the provider.

Client Credentials Flow

$provider = new Unitedworldwrestling\OAuth2\Client\Provider\Athena([
    'clientId'          => '{athena-client-id}',
    'clientSecret'      => '{athena-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url',
    'host'              => 'https://api.instagram.com' // Optional, defaults to https://api.instagram.com
]);


// Try to get an access token (using the https://athena.uww.io/grants/api_key grant)
$token = $provider->getAccessToken('https://athena.uww.io/grants/api_key');

// Optional: Now you have a token you can look up a users profile data
try {

    // We got an access token, let's now get the user's details
    $user = $provider->getResourceOwner($token);

    // Use these details to create a new profile
    printf('Hello %s!', $user->getName());

} catch (Exception $e) {

    // Failed to get user details
    exit('Oh dear...');
}

// Use this to interact with an API on the users behalf
echo $token->getToken();

统计信息

  • 总下载量: 5.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-05