I am looking at this with Mikey. The problem I see is that the code to insert the user into the database after the LDAP authentication doesn't match up with the fields in the database:

Here is the SQL that tries to insert the user into the database as we have LDAP__AUTO_CREATE_USER=TRUE,

Fri Jul 13 10:48:41.766872 2018] [:error] [pid 62648] [client] INSERT INTO pa2_user SET forename = 'Matthew', lastname = 'Edwardson-Williams', email = [log in to unmask], user_type = 'T', username = 'EEEEE', password = 'DDDDDDD', source_id = '' ON DUPLICATE KEY UPDATE forename = 'Matthew', lastname = 'Edwardson-Williams', email = [log in to unmask], user_type = 'T

Note the user_type field.

Here is the SQL script to set up pa2_user, note NO user_type field:

CREATE TABLE pa2_user (
user_id int(10) unsigned NOT NULL AUTO_INCREMENT,
source_id varchar(255) NOT NULL DEFAULT '',
username varchar(255) NOT NULL,
`password` varchar(45) NOT NULL,
id_number varchar(255) DEFAULT NULL,
department_id varchar(255) DEFAULT NULL,
forename varchar(255) NOT NULL,
lastname varchar(255) NOT NULL,
email varchar(255) DEFAULT NULL,
admin tinyint(1) NOT NULL DEFAULT '0',
disabled tinyint(1) NOT NULL DEFAULT '0',
date_last_login datetime DEFAULT NULL,
last_module_id int(10) DEFAULT NULL,
PRIMARY KEY (user_id)

And here is the actual database we are using, again no user_type:

MariaDB [its_webpa]> show columns from pa2_user;
| Field           | Type             | Null | Key | Default | Extra          |
| user_id         | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| source_id       | varchar(255)     | NO   | MUL |         |                |
| username        | varchar(255)     | NO   |     | NULL    |                |
| password        | varchar(45)      | NO   |     | NULL    |                |
| id_number       | varchar(255)     | YES  |     | NULL    |                |
| department_id   | varchar(255)     | YES  |     | NULL    |                |
| forename        | varchar(255)     | NO   |     | NULL    |                |
| lastname        | varchar(255)     | NO   |     | NULL    |                |
| email           | varchar(255)     | YES  |     | NULL    |                |
| admin           | tinyint(1)       | NO   |     | 0       |                |
| disabled        | tinyint(1)       | NO   |     | 0       |                |
| date_last_login | datetime         | YES  |     | NULL    |                |
| last_module_id  | int(10)          | YES  |     | NULL    |                |
13 rows in set (0.00 sec)

The insert fails and that stops the login process.

Are we missing something?



Dr Matthew Edwardson-Williams
Gweinyddwr Systemau
Gwasanaethau TG

E-bost: [log in to unmask]
Ffn: 01248 382414
Ffn symudol: 07979778269

Prifysgol Bangor, Bangor, Gwynedd, LL57 2DG

@prifysgolbangor /PrifysgolBangor
Dr Matthew Edwardson-Williams
Systems Administrator
IT Services

Email: [log in to unmask]
Phone: 01248 382414
Mobile phone: 07979778269

Bangor University, Bangor, Gwynedd, LL57 2DG

@BangorUni /BangorUniversity

From: WebPA <[log in to unmask]> on behalf of Andrew Millington <[log in to unmask]>
Sent: 09 July 2018 16:43:02
To: [log in to unmask]
Subject: Re: AD (LDAP) authentcation

Hi Mikey,

    I believe that the latest version of WebPA ( works with LDAP as I've set it up previously without issue. Can you provide more information about the discrepancy you are seeing with the database code?

Where did you download WebPA from? The last stable version can be downloaded here:

All the best,

Andrew Millington
Learning Applications Development Team Manager | Digital Learning Applications and Media
Tel: +44 (0)131 651 1266 | H West, Argyle House, Edinburgh, EH3 9DR

On 09/07/18 16:19, Mikey West wrote:

Can anyone help?

We are trying to set up WebPA to authenticate using AD (LDAP).

We have managed to authenticate using AD (LDAP), but from debugging the code, it looks like the insert of the user into the database fails as the structure of the SQL insert command does not match the structure of the WebPA database.

Any ideas? Solutions? 

Can you confirm what version you are using? Please note that we are using version 2.

With best wishes

Mikey West
Bangor University


To unsubscribe from the WEBPA list, click the following link:

To unsubscribe from the WEBPA list, click the following link:


Mae croeso i chi gysylltu gyda'r Brifysgol yn Gymraeg neu Saesneg

You are welcome to contact the University in Welsh or English

Rhif Elusen Gofrestredig 1141565 - Registered Charity No. 1141565

Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi, gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar unwaith a dilewch y neges. Os na fwriadwyd anfon y neges atoch chi, rhaid i chi beidio a defnyddio, cadw neu ddatgelu unrhyw wybodaeth a gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn Prifysgol Bangor. Nid yw Prifysgol Bangor yn gwarantu bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu 100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa Cyllid Prifysgol Bangor.

This email and any attachments may contain confidential material and is solely for the use of the intended recipient(s). If you have received this email in error, please notify the sender immediately and delete this email. If you are not the intended recipient(s), you must not use, retain or disclose any information contained in this email. Any views or opinions are solely those of the sender and do not necessarily represent those of Bangor University. Bangor University does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of the text of the email, this email is not intended to form a binding contract - a list of authorised signatories is available from the Bangor University Finance Office.

To unsubscribe from the WEBPA list, click the following link: