Autenticação de clientes via Active Directory

Post Reply
andersonvieira
Znuny newbie
Posts: 4
Joined: 15 Aug 2012, 21:58
Znuny Version: OTRS 6.0
Real Name: Anderson Vieira
Location: Salvador

Autenticação de clientes via Active Directory

Post by andersonvieira »

Prezados,
Não obtenho sucesso utilizando a seguinte configuração:

CENÁRIO:
Servidor OTRS: Linux Debian com Net::LDAP instalado e com o ldap.conf configurado apontando para o meu servidor de domínio Windows.
Servidor de Dominio: Windows Server 2008 Standard apenas com a função AD DS, sem o AD LDS.

Arquivo /opt/otrs/Kernel/Config.pm

Code: Select all

$Self->{AuthModule} = 'Kernel::System::Auth::LDAP';
$Self->{'AuthModule::LDAP::Host'} = 'servidor.dominio.central';
$Self->{'AuthModule::LDAP::BaseDN'} = 'dc=dominio,dc=central';
$Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';

$Self->{AuthSyncModule} = 'Kernel::System::Auth::Sync::LDAP';
$Self->{'AuthSyncModule::LDAP::Host'} = 'servidor.dominio.central';
$Self->{'AuthSyncModule::LDAP::BaseDN'} = 'dc=dominio,dc=central';
$Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';

$Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };

    $Self->{'AuthSyncModule::LDAP::Params'} = {
        port    => 389,
        timeout => 120,
        async   => 0,
        version => 3,
    };
Erro: Autenticação falhou! Nome de usuário ou senha foram digitados incorretamente.

Alguém pode me ajudar?
Anderson Vieira
IT Manager
thiagopachecoit
Znuny newbie
Posts: 14
Joined: 26 Aug 2012, 16:01
Znuny Version: 5.0.x
Real Name: Thiago Pacheco
Company: Unirede Soluções Corporativas

Re: Autenticação de clientes via Active Directory

Post by thiagopachecoit »

Meu arquivo de configuração esta assim:

Code: Select all

######################### Customers Users #######################
 # CustomerUser    # (customer user ldap backend and settings)
    $Self->{CustomerUser} = {
        Name => 'Empresa AD Users',
        Module => 'Kernel::System::CustomerUser::LDAP',
        Params => {
            # Maquina AD
            Host => 'dc01.empresa.com.br',
            # ldap base dn
            BaseDN => 'DC=empresa,DC=com,DC=br',
            # search scope (one|sub)
            SSCOPE => 'sub',
#            # The following is valid but would only be necessary if the
#            # anonymous user does NOT have permission to read from the LDAP tree
			 # Usuário com direito de acesso no de leitura no AD	
            UserDN => 'CN=user,OU=Usuarios,DC=empresa,DC=com,DC=br',
            UserPw => 'senha_do_user',
            # in case you want to add always one filter to each ldap query, use
            # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
#            AlwaysFilter => '',
            # if your frontend is e. g. iso-8859-1 and the charset of your
            # ldap server is utf-8, use these options.
#            SourceCharset => 'utf-8',
#            DestCharset => 'iso-8859-1',
            # if both your frontend and your LDAP are unicode, use this:
            SourceCharset => 'utf-8',
            DestCharset   => 'utf-8',

            # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
            Params => {
                port => 3268,
                timeout => 120,
                async => 0,
                version => 3,
            },
        },
                ReadOnly => 1,
                # customer unique id
        CustomerKey => 'sAMAccountName',
        # customer #
        CustomerID => 'mail',
        CustomerUserListFields => ['cn', 'mail'],
        CustomerUserSearchFields => ['cn', 'givenname', 'mail'],
        CustomerUserSearchPrefix => '',
        CustomerUserSearchSuffix => '*',
        CustomerUserSearchListLimit => 500,
        CustomerUserPostMasterSearchFields => ['mail'],
        CustomerUserNameFields => ['givenname', 'sn'],
        # show not own tickets in customer panel, CompanyTickets
        CustomerUserExcludePrimaryCustomerID => 0,
        # add an ldap filter for valid users (expert setting)
#       CustomerUserValidFilter => '(!(description=locked))',
        # administrator can't change customer preferences
        AdminSetPreferences => 0,
#        # cache time to live in sec. - cache any database queries
        CacheTTL => 120,
        Map => [
            # note: Login, Email and CustomerID are mandatory!
            # if you need additional attributes from AD, just map them here.
            # var, frontend, storage, shown (1=always,2=lite), required, storage-type, http-link, readonly
#            [ 'UserSalutation', 'Title',      'title',           1, 0, 'var', '', 0 ],
            [ 'UserFirstname',  'Firstname',   'givenname',       1, 1, 'var', '', 0 ],
            [ 'UserLastname',   'Lastname',    'sn',              1, 1, 'var', '', 0 ],
            [ 'UserLogin',      'Username',    'sAMAccountName',             1, 1, 'var', '', 0 ],
            [ 'UserEmail',      'Email',       'mail',            1, 1, 'var', '', 0 ],
            [ 'UserCustomerID', 'CustomerID',  'mail',            0, 1, 'var', '', 0 ],
#            [ 'UserCustomerIDs', 'CustomerIDs', 'second_customer_ids', 1, 0, 'var', '', 0 ],
            [ 'UserPhone',      'Phone',      'telephoneNumber', 1, 0, 'var', '', 0 ],
#            [ 'UserAddress',    'Address',    'postaladdress',   1, 0, 'var', '', 0 ],
#            [ 'UserComment',    'Comment',    'description',     1, 0, 'var', '', 0 ],
            [ 'UserMobile',     'Mobile',      'mobile', 1, 0, 'var', '', 0 ],
            [ 'UserRoom',       'Room',        'physicalDeliveryOfficeName', 1, 0, 'var', '', 0 ],
        ],
    };
#################################################################
######################### END Customers Users ###################
#################################################################

######################### Agents Users #######################
# This is an example configuration for using an MS AD backend
    $Self->{'AuthModule'} = 'Kernel::System::Auth::LDAP';
    $Self->{'AuthModule::LDAP::Host'} = 'dc01.empresa.com.br';
    $Self->{'AuthModule::LDAP::BaseDN'} = 'DC=empresa,DC=com,DC=br';
    $Self->{'AuthModule::LDAP::UID'} = 'sAMAccountName';

    # Check if the user is allowed to auth in a posixGroup
    # (e. g. user needs to be in a group OTRS_Agents to use otrs)
	# Aqui vai o Grupo de usuários que poderao logar como agentes
    $Self->{'AuthModule::LDAP::GroupDN'} = 'CN=otrs_agents,OU=Tecnologia,OU=Usuarios,DC=empresa,DC=com,DC=br';
    $Self->{'AuthModule::LDAP::AccessAttr'} = 'member';
    $Self->{'AuthModule::LDAP::UserAttr'} = 'DN';

    # Bind credentials to log into AD
    $Self->{'AuthModule::LDAP::SearchUserDN'} = 'CN=user,OU=Usuarios,DC=empresa,DC=com,DC=br';
    $Self->{'AuthModule::LDAP::SearchUserPw'} = 'senha_do_user';

    # in case you want to add always one filter to each ldap query, use
    # this option. e. g. AlwaysFilter => '(mail=*)' or AlwaysFilter => '(objectclass=user)'
    $Self->{'AuthModule::LDAP::AlwaysFilter'} = '';

    # in case you want to add a suffix to each login name,  then
    # you can use this option. e. g. user just want to use user but
    # in your ldap directory exists user@domain.
    #$Self->{'AuthModule::LDAP::UserSuffix'} = '';

    # Net::LDAP new params (if needed - for more info see perldoc Net::LDAP)
    $Self->{'AuthModule::LDAP::Params'} = {
        port => 389,
        timeout => 120,
        async => 0,
        version => 3,
    };

   # Now sync data with OTRS DB
    $Self->{'AuthSyncModule'} = 'Kernel::System::Auth::Sync::LDAP';
    $Self->{'AuthSyncModule::LDAP::Host'} = 'dc01.empresa.com.br';
    $Self->{'AuthSyncModule::LDAP::BaseDN'} = 'DC=empresa,DC=com,DC=br';
    $Self->{'AuthSyncModule::LDAP::UID'} = 'sAMAccountName';
    $Self->{'AuthSyncModule::LDAP::SearchUserDN'} = 'CN=user,OU=Usuarios,DC=empresa,DC=com,DC=br';
    $Self->{'AuthSyncModule::LDAP::SearchUserPw'} = 'senha_do_user';

    $Self->{'AuthSyncModule::LDAP::UserSyncMap'} = {
        # DB -> LDAP
        UserFirstname => 'givenName',
        UserLastname  => 'sn',
        UserEmail     => 'mail',
    };

    # AuthSyncModule::LDAP::UserSyncInitialGroups
    # (sync following group with rw permission after initial create of first agent
    # login)
    $Self->{'AuthSyncModule::LDAP::UserSyncInitialGroups'} = [
        'users',
    ];
#################################################################
######################### END Agents Users ######################
#################################################################
Acho que seu problema é de configuração do OTRS e não do AD.
--

Thiago Pacheco
ITSM Consulting

- PMP
- ITIL V2 Manager / ITIL V3 Expert
- LPI 1,2,3
Utilizador de OTRS 5, OTRS 4, OTRS 3.3.X, OTRS 3.2.X, OTRS 3.1.X
amdkryn
Znuny expert
Posts: 187
Joined: 02 Oct 2012, 02:52
Znuny Version: 5.0.27

Re: Autenticação de clientes via Active Directory

Post by amdkryn »

Pessoal, existe algum risco de eu cometer algum erro nos parametros e excluir algum usuario do meu AD ou será apenas um consulta para validar os dados? Nenhuma informação é inserido via LDAP?

Obrigado.
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.
amdkryn
Znuny expert
Posts: 187
Joined: 02 Oct 2012, 02:52
Znuny Version: 5.0.27

Re: Autenticação de clientes via Active Directory

Post by amdkryn »

amdkryn wrote:Pessoal, existe algum risco de eu cometer algum erro nos parametros e excluir algum usuario do meu AD ou será apenas um consulta para validar os dados? Nenhuma informação é inserido via LDAP?

Obrigado.
E ai galera, alguém pode esclarecer minha dúvida, por favor?
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.
amdkryn
Znuny expert
Posts: 187
Joined: 02 Oct 2012, 02:52
Znuny Version: 5.0.27

Re: Autenticação de clientes via Active Directory

Post by amdkryn »

amdkryn wrote:
amdkryn wrote:Pessoal, existe algum risco de eu cometer algum erro nos parametros e excluir algum usuario do meu AD ou será apenas um consulta para validar os dados? Nenhuma informação é inserido via LDAP?

Obrigado.
E ai galera, alguém pode esclarecer minha dúvida, por favor?
Novamente eu respondo minhas próprias dúvidas.... depois de ler toda a documentação, vi que o acesso ao dados do AD são somente leitura (ao menos via configuração padrão).

abraços.
OTRS version 5.0.27 (With ITSM), Operating System OpenSuse 12 with Mysql.
nicollas
Znuny newbie
Posts: 25
Joined: 07 May 2012, 19:32
Znuny Version: 3.1.2
Real Name: Nicollas Soares Viggiano
Company: CEPAM

Re: Autenticação de clientes via Active Directory

Post by nicollas »

essas configurações são para os atendentes, e nao para os customers. Tenta loga pelo localhost/index.pl e nao pelo customer.pl

Para conseguir logar no customer.pl é preciso fazer outro tipo de configuração que esta na documentação
Post Reply