2017 © Pedro Peláez
 

library learning-context-client-module

Zend Framework 2 module for the learning context client

image

xelax90/learning-context-client-module

Zend Framework 2 module for the learning context client

  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Learning Context Client Module

This is a small Zend Framework 2 module for xelax90/learning-context-client, (*1)

Setup

  • Install this module with composer, (*2)

    composer require xelax90/learning-context-client-module
    
  • Add LearningContextClientModule to your modules array in config/application.config.php, (*3)

    $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., (*4)

  • 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., (*5)

You can access the client via ServiceLocator using its class name:, (*6)

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

To check wether the user is authenticated, check if the client has a refresh token:, (*7)

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

For documentation about the client and the Learning Context API consult the respective documentations: * Client: https://github.com/xelax90/learning-context-client * Learning Context: http://learning-context.de/text/19/APIDoc, (*8)

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., (*9)

The Versions

21/06 2016

dev-master

9999999-dev

Zend Framework 2 module for the learning context client

  Sources   Download

BSD-2-Clause

The Requires

 

by Aleksandr

21/06 2016

v1.0.1

1.0.1.0

Zend Framework 2 module for the learning context client

  Sources   Download

BSD-2-Clause

The Requires

 

by Aleksandr

12/06 2016

v1.0

1.0.0.0

Zend Framework 2 module for the learning context client

  Sources   Download

BSD-2-Clause

The Requires

  • ext-curl *

 

by Aleksandr