[rt-users] add MySQL authentication

Michael Mai Michael.Mai at oicr.on.ca
Tue Apr 21 13:06:44 EDT 2009


Hi,

I am using External Authentication with LDAP. But also would like to add MYSQL as another source for login. 

After created a table in rt3 database, I made following changes in RT_SiteConfig.pm:

'My_MySQL'   =>  {      ## GENERIC SECTION
                                                        # The type of service (db/ldap/cookie) 
                                                        'type'                      =>  'db',
                                                        # The server hosting the service
                                                        'server'                    =>  'server.domain.tld',
                                                        ## SERVICE-SPECIFIC SECTION
                                                        # The database name
                                                        'database'                  =>  'DB_NAME',
                                                        # The database table
                                                        'table'                     =>  'USERS_TABLE',
                                                        # The user to connect to the database as
                                                        'user'                      =>  'DB_USER',
                                                        # The password to use to connect with
                                                        'pass'                      =>  'DB_PASS',
                                                        # The port to use to connect with (e.g. 3306)
                                                        'port'                      =>  'DB_PORT',
                                                        # The name of the Perl DBI driver to use (e.g. mysql)
                                                        'dbi_driver'                =>  'DBI_DRIVER',
                                                        # The field in the table that holds usernames
                                                        'u_field'                   =>  'username',
                                                        # The field in the table that holds passwords
                                                        'p_field'                   =>  'password',
                                                        
                                                        #
                                                        # The field and values in the table that determines if a user should
                                                        # be disabled. For example, if the field is 'user_status' and the values
                                                        # are ['0','1','2','disabled'] then the user will be disabled if their
                                                        # user_status is set to '0','1','2' or the string 'disabled'.
                                                        # Otherwise, they will be considered enabled.
                                                        'd_field'                   =>  ' user_status ',
                                                        'd_values'                  =>  ['0'],
                                                        ## RT ATTRIBUTE MATCHING SECTION
                                                        # The list of RT attributes that uniquely identify a user
                                                        'attr_match_list'           =>  [   'Gecos',
                                                                                            'Name'
                                                                                        ],
                                                        # The mapping of RT attributes on to field names
                                                        'attr_map'                  =>  {   'Name' => 'username',
                                                                                            'EmailAddress' => 'email',
                                                                                            'ExternalAuthId' => 'username',
                                                                                            'Gecos' => 'userID'
                                                                                        }
                                                    },



More information about the rt-users mailing list