An open API service indexing awesome lists of open source software.

https://github.com/arnaud-lb/albopenidserverbundle

OpenID Provider bundle
https://github.com/arnaud-lb/albopenidserverbundle

Last synced: about 2 months ago
JSON representation

OpenID Provider bundle

Awesome Lists containing this project

README

        

# AlbOpenIDServerBundle

OpenID Provider bundle.

This is a work in progress and untested, **do not use**.

## Installation

### Step1: Download AlbOpenIDServerBundle

#### Using the vendors script

Add the following lines in your deps file:

```
[AlbOpenIDServerBundle]
git=git://github.com/arnaud-lb/AlbOpenIDServerBundle.git
target=bundles/Alb/AlbOpenIDServerBundle

[php-openid]
git=git://github.com/openid/php-openid.git
target=openid/php-openid
```

Now, run the vendors script to download the bundle:

``` sh
$ php bin/vendors install
```

#### Using submodules

If you prefer instead to use git submodules, then run the following:

``` sh
$ git submodule add git://github.com/arnaud-lb/AlbOpenIDServerBundle.git vendor/bundles/Alb/AlbOpenIDServerBundle
$ git submodule add git://github.com/openid/php-openid.git vendor/openid/php-openid
$ git submodule update --init
```

#### Using composer

TODO

### Step2: Configure the Autoloader

You can skip this step if you have installed the bundle using composer.

Add the ``Alb`` namespace to your autoloader:

``` php
registerNamespaces(array(
// ...
'Alb' => __DIR__.'/../vendor/',
));
```

### Step3: Configure the include path

php-openid relies on his classes to be in the include path:

``` php
;

use Alb\OpenIDServerBundle\Adapter\AdapterInterface;

class Adapter implements AdapterInterface
{
public function getUserUnique($user)
{
return $user->getId();
}
}
```

Declare a service using this class:

``` yaml
# app/config/config.yml

services:
my_open_id_server_adapter:
class: \Adapter
```

## Configuring

### Bundle configuration

Add this to app/config/config.yml:

``` yaml
# app/config/config.yml

alb_open_id_server_bundle:
service:
adapter: my_open_id_server_adapter
```

### Routing

Add this to app/config/routing.yml:

``` yaml
# app/config/routing.yml
alb_open_id_server:
resource: "@AlbOpenIDServerBundle/Resources/config/routing.xml"
prefix: /openid
```

## Usage

The OpenID endpoint is at /openid (depending on the routes prefix)

## TODO

- Add tests
- More documentation