Hi everyone, I'm trying to implement authentication between D8 and Moodle 3.7.2
D8 as a CAS Server, I use the CAS server module for moodle https://github.com/middlebury/Moodle-auth_casattras
The initial error was the following Drupal \ Core \ Database \ DatabaseExceptionWrapper: SQLSTATE [22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "2019-09-12 18:56:46" LINE 1: ... 'ST -hZUec08prWhJWrfbvIp7eJ_e6NYg4_ItZRoXtx3N4hs ',' 2019-09-1 ... ^: INSERT INTO cas_server_ticket_store (id, expiration, type, session, uid, "user", service, renew) VALUES (: db_place_place_place_place_b_place_ins ,: db_insert_placeholder_4,: db_insert_placeholder_5,: db_insert_placeholder_6,: db_insert_placeholder_7); Array () in Drupal \ cas_server \ Ticket \ TicketFactory-> createServiceTicket () (line 111 of /var/www/example.com/web/modules/contrib/cas_server/src/Ticket/TicketFactory.php).
When trying to use the patch
https://www.drupal.org/project/cas_server/issues/2811661 →
I got an application error, but I added everything with my hands where - removed where + added. Now the DatabaseTicketStorage.php file
looks at line 39-46
public function storeServiceTicket (ServiceTicket $ ticket) {
$ this-> connection-> insert ('cas_server_ticket_store')
-> fields (
array ('id', 'expiration', 'type', 'session', 'uid', 'user', 'service', 'renew'),
array ($ ticket-> getId (), date ('Ymd H: i: s', $ ticket-> getExpirationTime ()), 'service', $ ticket-> getSession (), $ ticket-> getUser (), $ ticket-> getService (), (int) $ ticket-> getRenew ())
)
-> execute ();
}
In line 92-99
public function storeProxyTicket (ProxyTicket $ ticket) {
$ this-> connection-> insert ('cas_server_ticket_store')
-> fields (
array ('id', 'expiration', 'type', 'session', 'uid', 'user', 'service', 'renew', 'proxy_chain'),
array ($ ticket-> getId (), date ('Ymd H: i: s', $ ticket-> getExpirationTime ()), 'proxy', $ ticket-> getSession (), $ ticket-> getUser (), $ ticket-> getService (), (int) $ ticket-> getRenew (), serialize ($ ticket-> getProxyChain ()))
)
-> execute ();
}
The error then disappeared.
But another appeared
Drupal \ Core \ Database \ DatabaseExceptionWrapper: SQLSTATE [HY093]: Invalid parameter number: number of bound variables does not match number of tokens: INSERT INTO cas_server_ticket_store (id, expiration, type, session, uid, "user", service, renew) VALUES (: db_insert_placeholder_0,: db_insert_placeholder_1,: db_insert_placeholder_2,: db_insert_placeholder_3,: db_insert_placeholder_4,: db_insert_placeholder_5,: db_insert_placeholder_6); Array () in Drupal \ cas_server \ Ticket \ TicketFactory-> createServiceTicket () (line 111 of /var/www/example.com/web/modules/contrib/cas_server/src/Ticket/TicketFactory.php).
Both sites use https
URL D8 example.com
URL Moodle 3.7.2
moodle.example.com
Time corresponds to the region, the date is correct.
Settings with D8 and Moodle wise
Please help.