-
Notifications
You must be signed in to change notification settings - Fork 77
FR3DLdapBundle and Symfony 2.1 #15
Comments
i have this error: |
Hi @symfony24 With Symfony 2.1 you should add the bundle using the Composer package Anyway in 1.6 and 2.0 branch there are documentation about how to install it with SF 2.1 https://github.com/Maks3w/FR3DLdapBundle/blob/1.6.x/Resources/doc/index.md |
thx a lot, now, i'm trying to authenticate, i have this error: this is my config.ymlfos_user: fr3d_ldap: version: 3 # Optional { ldap_attr: uid, user_method: setUsername } # Default and my security.ymlsecurity: please help, thank you ! |
Please edit your message and add markup for format the config as YAML
Anyway it's not possible to have useSsl and useStartTls enable at the same time, you must choose one of them |
no it's not enabled. security.yml security:
providers:
chain_provider:
chain:
providers: [fos_userbundle, fr3d_ldapbundle]
fos_userbundle:
id: fos_user.user_manager
fr3d_ldapbundle:
id: fr3d_ldap.security.user.provider
firewalls:
main:
pattern: ^/
fr3d_ldap: ~
form_login:
provider: chain_provider
always_use_default_target_path: true
default_target_path: /
logout: true
anonymous: true and config.yml fr3d_ldap:
client:
host: 192.168.8.95
port: 389 # Optional
# version: 3 # Optional
username: cn=Administrateur
password: Key11ogger
# optReferrals: false # Optional
# useSsl: true # Enable SSL negotiation. Optional
# useStartTls: true # Enable TLS negotiation. Optional
user:
baseDn: dc=talan, dc=local
filter: (&(ObjectClass=Person))
attributes: # Specify ldap attributes mapping [ldap attribute, user object method]
- { ldap_attr: uid, user_method: setUsername } # Default
# - { ldap_attr: cn, user_method: setName } # Optional
# - { ldap_attr: ..., user_method: ... } # Optional
- { ldap_attr: mail, user_method: setEmail } and my User.php <?php
// src/Acme/UserBundle/Entity/User.php
namespace Talan\VpnBundle\Entity;
use FR3D\LdapBundle\Model\LdapUserInterface;
use FOS\UserBundle\Entity\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser implements LdapUserInterface
{
/**
* @var integer $id
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* Ldap Object Distinguished Name
* @var string $dn
*/
protected $dn;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
public function __construct()
{
parent::__construct();
// your own logic
}
/**
* {@inheritDoc}
*/
public function getDn() {
return $this->dn;
}
/**
* {@inheritDoc}
*/
public function setDn($dn) {
$this->dn = $dn;
}
} |
|
great authentication work fine thx to this topic #10 |
At this moment I don't provide support for roles but seems that @jkostrz applied a patch for it https://github.com/jkostrz/FR3DLdapBundle |
i try to use FR3DLdapBundle in Symfony 2.1, but there is no documentation to install it.
please help
The text was updated successfully, but these errors were encountered: