Skip to content

rurri/zf2-cas-authentication-adapter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CAS authentication adapter for Zend Framework 2

CAS is an authentication system originally created by Yale University to provide a trusted way for an application to authenticate a user.

http://www.jasig.org/cas/

Requirements

  • Zend Framework 2 HTTP client
  • Zend Framework 2 Authentication framework

Installation

Add this repository to your composer.json:

{
    "repositories": [
       {
           "type": "vcs",
           "url": "https://github.com/tillikum/zf2-cas-authentication-adapter"
       }
    ],
    "require": {
        "tillikum/zf2-cas-authentication/adapter": "dev-master"
    }
}

then composer update.

Usage

<?php

use Tillikum\Authentication\Adapter\Cas as CasAdapter;
use Zend\Authentication;
use Zend\Http;

$httpClient = new Http\Client();

// Standalone

$adapter = new CasAdapter(
    $httpClient,
    'http://localhost/cas'
);

$result = $adapter->authenticate(
    array(
        'service' => 'http://my/current/url',
        'ticket' => 'ST-ACME-123',
    )
);

// Plugged in to Zend\Authentication

$authService = new Authentication\AuthenticationService(
    new Authentication\Storage\NonPersistent(),
    $adapter
);

$result = $authService->authenticate(
    array(
        'service' => 'http://my/current/url',
        'ticket' => 'ST-ACME-123',
    )
);

About

CAS authentication adapter for Zend Framework 2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%