Commit 9bd32dc0 authored by Francois Marier's avatar Francois Marier
Browse files

auth/saml: better error message when required fields are missing



Bug #724471
Signed-off-by: default avatarFrancois Marier <francois@catalyst.net.nz>
parent 5a8af297
......@@ -35,6 +35,7 @@ $string['errnosamluser'] = 'No User found';
$string['errorbadlib'] = 'SimpleSAMLPHP lib directory %s is not correct.';
$string['errorbadconfig'] = 'SimpleSAMLPHP config directory %s is in correct.';
$string['errorbadcombo'] = 'You can only choose user auto creation if you have not selected remoteuser';
$string['errormissinguserattributes'] = 'You seem to be authenticated but we did not receive the required user attributes. Please check that your Identity Provider releases these SSO fields for First Name, Surname, and Email to the Service Provider Mahara is running on or inform the webmaster of this server.';
//$string['idpidentity'] = 'IdP Identity Service';
$string['institutionattribute'] = 'Institution attribute (contains "%s")';
$string['institutionvalue'] = 'Institution value to check against attribute';
......
......@@ -96,6 +96,10 @@ class AuthSaml extends Auth {
$lastname = $attributes[$this->config['surnamefield']][0];
$email = $attributes[$this->config['emailfield']][0];
$institutionname = $this->institution;
if (!$firstname or !$lastname or !$email) {
throw new AuthInstanceException(get_string('errormissinguserattributes', 'auth.saml'));
}
$create = false;
$update = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment