PHPackages                             flexcoders/opauth-ldap - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. flexcoders/opauth-ldap

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

flexcoders/opauth-ldap
======================

Ldap strategy for Opauth

0.2(11y ago)0152MITPHPPHP &gt;=5.2.0

Since May 4Pushed 10y ago2 watchersCompare

[ Source](https://github.com/FlexCoders/opauth-ldap)[ Packagist](https://packagist.org/packages/flexcoders/opauth-ldap)[ Docs](http://flexcoders.co.uk)[ RSS](/packages/flexcoders-opauth-ldap/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Opauth-Ldap
===========

[](#opauth-ldap)

[Opauth](https://github.com/opauth/opauth) strategy for Ldap authentication.

Opauth is a multi-provider authentication framework for PHP.

Getting started
---------------

[](#getting-started)

1. Install Opauth-Ldap:

    ```
    cd path_to_opauth/Strategy
    git clone git://github.com/flexcoders/opauth-ldap.git ldap
    ```
2. Configure Opauth-Ldap strategy.
3. Call it.

Since this is not an HTTP based protocol, some of the standard Opauth config does not apply. There is no redirection involved, and a username and password needs to be passed.

You call it like so:

```
// some input vars
$providerName = "Ldap";

// prep a config
$config = [
	'provider' => $providerName,
	'username' => $_POST['username'],
	'password' => $_POST['password'],
	'request_uri' => '/current/uri/'.strtolower($providerName),
	'callback_url' => '/your/uri/for/callback/'.strtolower($providerName),
];

// construct the Opauth object
$this->opauth = new \Opauth($config, true);

```

It will attempt an LDAP login, and then redirect to the callback url, just like with all other Opauth strategies, and with a similar response.

Strategy configuration
----------------------

[](#strategy-configuration)

Required parameters:

```
