xelax90/learning-context-client-module 问题修复 & 功能扩展

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

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

xelax90/learning-context-client-module

Composer 安装命令:

composer require xelax90/learning-context-client-module

包简介

Zend Framework 2 module for the learning context client

README 文档

README

This is a small Zend Framework 2 module for xelax90/learning-context-client

Setup

  • Install this module with composer
composer require xelax90/learning-context-client-module
  • Add LearningContextClientModule to your modules array in config/application.config.php
 $config = array(
   'modules' => array(
     // ...
     'LearningContextClientModule',
     // ...
   ),
   // ...
);
  • Copy the provided local configuration under vendor/xelax90/learning-context-client-module/learning-context.local.php.dist into your config/autoload folder and copy it again without the .dist extension.
  • Enter your app id and secret into the conig/autoload/learning-context.local.php file.
  • Enter the callback_url. The callback URL is the URL corresponding to the learning-context/callback route.
  • Enter the redirect_after_authentication. It can be either a full URL or route name. This is the place where the authentication controller will redirect to after successful or unsuccessful authentication.

Usage

You can use the learning-context/authenticate route for authentication. Access /learning-context/authenticate in the browser and the authentication process starts.

You can access the client via ServiceLocator using its class name:

use LearningContextClient\Client;
$client = $container->get(Client::class);

To check wether the user is authenticated, check if the client has a refresh token:

$authenticated = $client->getRefreshToken() !== null;
if($authenticated){
  // authenticated
} else {
  // not authenticated
}

For documentation about the client and the Learning Context API consult the respective documentations:

Events

The LearningContextClientModule\Controller\LearningContextController class triggers authentication events when the callback URL is accessed. It triggers learning-context.authorized if a refresh token was provided and learning-context.unauthorized if not.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-2-Clause
  • 更新时间: 2016-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固