承接 neclimdul/oauth2-marketo 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

neclimdul/oauth2-marketo

最新稳定版本:v2.0.3

Composer 安装命令:

composer require neclimdul/oauth2-marketo

包简介

Marketo OAuth 2.0 support for the PHP League's OAuth2-Client

README 文档

README

Software License

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

This package is based on https://github.com/kristenlk/oauth2-marketo and mostly just updated to support newer releases of dependencies.

Installation

To install, use composer:

composer require neclimdul/oauth2-marketo

Usage

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

Authorization Code Flow

Marketo's REST APIs are authenticated with two-legged OAuth 2.0. We don't need to pass a redirectUri to the provider, but we do need to include a base url that will be used to request an access token.

<?php
$provider = new \NecLimDul\OAuth2\Client\Provider\Marketo([
    'clientId'          => '{marketo-client-id}',
    'clientSecret'      => '{marketo-client-secret}',
    'baseUrl'           => 'https://your-base-url.mktorest.com'
]);

// Try to get an access token (using the client credentials grant)
$token = $provider->getAccessToken('client_credentials');

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

If the access token expires, we can just call getAccessToken() again.

Testing

$ ./vendor/bin/phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-18