mailium/oauth-client-php
Composer 安装命令:
composer require mailium/oauth-client-php
包简介
Library for authenticating with Mailium Oauth Server
关键字:
README 文档
README
Mailium Oauth Client provides easy to use wrappers for authorizing your application and getting the tokens required to talk to the API.
Example application
An example application can be found under example directory.
This is a simple working application that utilizes most of the features of the client.
Quick Start
First, let's install the library with composer:
composer require mailium/oauth-client-php
Initialize the client with your client_id and client_secret
$oauthClient = new MailiumOauthClient(); $oauthClient->setClientID("YOUR_CLIENT_ID"); $oauthClient->setClientSecret("YOUR_CLIENT_SECRET"); $oauthClient->setRedirectUri("YOUR_REDIRECT_URI"); // Scopes that your application need $oauthClient->addScope(MailiumOauthClient::SCOPE_BASIC); $oauthClient->addScope(MailiumOauthClient::SCOPE_CAMPAIGN_READ); $oauthClient->addScope(MailiumOauthClient::SCOPE_SUBSCRIBER_LIST_READ); // Set the callback method to store the oauth token $oauthClient->setTokenStoreCallbackFunction("storeToken");
Creating authorization URL
$authorizationUrl = $oauthClient->createAuthorizationUrl();
Getting the tokens after receiving the authorization code
$oauthClient->authorize($authorizationCode);
Getting Resource Owner
$oauthClient->getResourceOwner();
统计信息
- 总下载量: 933
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GNU
- 更新时间: 2016-08-03