# 使用 Discourse SSO 与 Mediawiki

**URL:** https://meta.discourse.org/t/use-discourse-sso-with-mediawiki/69218
**Category:** Administrators
**Tags:** sso, how-to
**Created:** [2017年九月1日 16:57 UTC](https://meta.discourse.org/t/use-discourse-sso-with-mediawiki/69218 "2017-09-01T16:57:44Z")
**Posts on this page:** 1
**Showing post:** 14

<div class="post-metadata">

### Author: ![jhf2442](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jhf2442/32/131921_2.png) [@jhf2442](https://meta.discourse.org/u/jhf2442)
#### Post date: [2019年三月25日 16:45 UTC](https://meta.discourse.org/t/use-discourse-sso-with-mediawiki/69218/14 "2019-03-25T16:45:39Z")

</div>

Anyone using this “as is” ? in addNonce function, the query

```
$this->mysqli->query("INSERT INTO ".SSO_DB_TABLE." (`id`, `nonce`, `logged`, `expire`) VALUES (NULL, '$nonce', '0', '".$expire."');");

```

fails because : `#1364 - Field 'admin' doesn't have a default value` and actually, the definition for the field in $sqlStructure says `admin Tinyint(1) NOT NULL` ☹

(same for “moderator” field BTW)

Working code 🙂

```
$this->mysqli->query("INSERT INTO ".SSO_DB_TABLE." (`id`, `nonce`, `logged`, `expire`,`admin`,`moderator`) VALUES (NULL, '$nonce', '0', '".$expire."',0,0);");`

```

---

_[View the full topic](https://meta.discourse.org/t/use-discourse-sso-with-mediawiki/69218)._
