diff --git a/info.textgrid.middleware.tgauth.webauth/WebAuthN/PutAttributes.php b/info.textgrid.middleware.tgauth.webauth/WebAuthN/PutAttributes.php index ff9ce972eb7cbe022e4de00421336eebb46a9577..3a493661fba0470ae830dec4a263d032e8cea1a5 100755 --- a/info.textgrid.middleware.tgauth.webauth/WebAuthN/PutAttributes.php +++ b/info.textgrid.middleware.tgauth.webauth/WebAuthN/PutAttributes.php @@ -11,7 +11,7 @@ include("../tglib/LDAP.class.php"); include("../tglib/WebUtils.class.php"); -$configfile = "../../../config_tgwebauth.xml"; +$configfile = "/etc/textgrid/tgauth/conf/config_tgwebauth.xml"; $util = new WebUtils; diff --git a/info.textgrid.middleware.tgauth.webauth/WebAuthN/authenticate.php b/info.textgrid.middleware.tgauth.webauth/WebAuthN/authenticate.php index 2cf5653f9e5269894483eb8bbdb689c87b48bce8..7caf443c77a87c5978cf3113c0e4a0f53f78436e 100644 --- a/info.textgrid.middleware.tgauth.webauth/WebAuthN/authenticate.php +++ b/info.textgrid.middleware.tgauth.webauth/WebAuthN/authenticate.php @@ -9,7 +9,7 @@ mb_internal_encoding("UTF-8"); $config = new DOMDocument(); -$config->load('../../../config_tgwebauth.xml'); +$config->load('/etc/textgrid/tgauth/conf/config_tgwebauth.xml'); $xpath = new DOMXPath($config); $xpath->registerNamespace("c", "http://textgrid.info/namespaces/middleware/tgwebauth"); diff --git a/info.textgrid.middleware.tgauth.webauth/locale/de/lang_main.inc b/info.textgrid.middleware.tgauth.webauth/locale/de/lang_main.inc index 64dec16656a9a9861236b9fc7de7e4bb74a6221d..49b51a4e2883360a92396d6c587554ccef764510 100644 --- a/info.textgrid.middleware.tgauth.webauth/locale/de/lang_main.inc +++ b/info.textgrid.middleware.tgauth.webauth/locale/de/lang_main.inc @@ -1,4 +1,4 @@ -authn_error_status = TextGrid konnte Sie nicht authentifizieren. +authn_error_status = DARIAH konnte Sie nicht authentifizieren. further_information = Weitere Angaben @@ -24,7 +24,7 @@ no_tgauth_instance_heading = Keine TgAuth-Instanz angegeben no_tgauth_instance_detail = Bitte geben Sie eine gültige Zeichenkette in der authZinstance-Variable an. -authn_failure_heading = Authentifizierung am TextGrid-Community-Account-Server fehlgeschlagen +authn_failure_heading = Authentifizierung am DARIAH-Community-Account-Server fehlgeschlagen authn_failure_detail_id_missing = Authentifizierung nicht möglich, keine Benutzer-ID angegeben. Wenn Sie Ihr Passwort vergessen haben, klicken Sie bitte auf die nachstehende Schaltfläche. @@ -38,7 +38,7 @@ sid_create_failure_heading = Sitzungserstellung in RBAC fehlgeschlagen shib_login_failure_heading = Shibboleth-Anmeldung über DFN-AAI fehlgeschlagen -shib_login_failure_detail = Kein Identifizierer angegeben. TextGrid benötigt das Attribut <b>eduPersonPrincipalName</b>, um Sie zu identifizieren, aber Ihre Organisation hat dieses nicht angegeben. Bitte setzen Sie sicht mit dem Rechenzentrum Ihrer Organisation in Verbindung, um dieses Attribut an TextGrid zu übermitteln. Siehe dazu <a href=\"http://www.textgrid.de/1-0/registrierung.html\">http://www.textgrid.de/1-0/registrierung.html</a>. +shib_login_failure_detail = Kein Identifizierer angegeben. TextGrid benötigt das Attribut <b>eduPersonPrincipalName</b>, um Sie zu identifizieren, aber Ihre Organisation hat dieses nicht angegeben. Bitte setzen Sie sicht mit dem Rechenzentrum Ihrer Organisation in Verbindung, um dieses Attribut an TextGrid zu übermitteln. Siehe dazu <a href=\"http://textgrid.de/registrierungdownload/registrierung\">http://textgrid.de/registrierungdownload/registrierung</a>. authn_succeeded_heading = Authentifizierung erfolgreich @@ -70,7 +70,7 @@ login_label_password = Passwort: login_button_shib = Anmelden über DFN-AAI -login_shib_explanation = Wenn Ihre Institution nicht in der Liste der Organisationen auf der DFN-AAI-Webseite geführt wird, oder wenn Sie während des Anmeldevorgangs auf ein Problem stoßen, können Sie gerne über das Webformular einen <a href="http://www.textgrid.de/1-0/registrierung.html"><b>TextGrid-Account beantragen</b></a>. +login_shib_explanation = Wenn Ihre Institution nicht in der Liste der Organisationen auf der DFN-AAI-Webseite geführt wird, oder wenn Sie während des Anmeldevorgangs auf ein Problem stoßen, können Sie gerne über das Webformular einen <a href="http://textgrid.de/registrierungdownload/registrierung"><b>DARIAH-Account beantragen</b></a>. attr_givenname = Vorname @@ -122,7 +122,7 @@ attr_citizenship_description = Ihre Nationalität attr_interest = Interessengebiet -attr_interest_description = Optionale Spezifizierung Ihrer Forschungsinteressen in Verbindung mit TextGrid +attr_interest_description = Optionale Spezifizierung Ihrer Forschungsinteressen in Verbindung mit DARIAH attr_personid = Personen-ID diff --git a/info.textgrid.middleware.tgauth.webauth/locale/en/lang_main.inc b/info.textgrid.middleware.tgauth.webauth/locale/en/lang_main.inc index 059dd434bec798eaeb3a11b2f74d7d4b9da3e595..08e39a01bd66d4121de1038ab22446f6237bfa1f 100644 --- a/info.textgrid.middleware.tgauth.webauth/locale/en/lang_main.inc +++ b/info.textgrid.middleware.tgauth.webauth/locale/en/lang_main.inc @@ -1,4 +1,4 @@ -authn_error_status = TextGrid could not authenticate you. +authn_error_status = DARIAH could not authenticate you. further_information = Further Information @@ -24,7 +24,7 @@ no_tgauth_instance_heading = No TgAuth Instance provided no_tgauth_instance_detail = Please provide a valid string in the authZinstance variable. -authn_failure_heading = Failure authenticating at TextGrid Community Account Server +authn_failure_heading = Failure authenticating at DARIAH Community Account Server authn_failure_detail_id_missing = Could not authenticate, no login ID provided. In case you forgot your password, please click the button below. @@ -38,7 +38,7 @@ sid_create_failure_heading = Failure Creating Session in RBAC shib_login_failure_heading = Shibboleth Login via DFN-AAI failed -shib_login_failure_detail = No identifier provided. TextGrid needs the attribute <b>eduPersonPrincipalName</b> to identify you, but your organisation did not provide it. Please inquire with your organisation's computing centre to release this attribute to TextGrid. See <a href=\"http://www.textgrid.de/1-0/registrierung.html\">http://www.textgrid.de/1-0/registrierung.html</a>. +shib_login_failure_detail = No identifier provided. TextGrid needs the attribute <b>eduPersonPrincipalName</b> to identify you, but your organisation did not provide it. Please inquire with your organisation's computing centre to release this attribute to TextGrid. See <a href=\"http://textgrid.de/registrierungdownload/registrierung\">http://textgrid.de/registrierungdownload/registrierung</a>. authn_succeeded_heading = Authentication succeeded @@ -70,7 +70,7 @@ login_label_password = Password: login_button_shib = log in via DFN-AAI -login_shib_explanation = If your school is not listed among the organizations on the DFN-AAI page, or if you encounter problems during log-in, you are welcome to <a href="http://www.textgrid.de/en/1-0/registrierung.html"><b>request a TextGrid account</b></a> using the form. +login_shib_explanation = If your school is not listed among the organizations on the DFN-AAI page, or if you encounter problems during log-in, you are welcome to <a href="http://textgrid.de/registrierungdownload/registrierung"><b>request a DARIAH account</b></a> using the form. attr_givenname = First Name @@ -122,7 +122,7 @@ attr_citizenship_description = Your Country of Citizenship attr_interest = Field of Interest -attr_interest_description = Optional specification of fields of research interests in conjuction with TextGrid +attr_interest_description = Optional specification of fields of research interests in conjuction with DARIAH attr_personid = Person ID diff --git a/info.textgrid.middleware.tgauth.webauth/tglib/LDAP.class.php b/info.textgrid.middleware.tgauth.webauth/tglib/LDAP.class.php index dc6433668d18cad4420842907a256e57c61a5218..d6d9206fa46b69cc77cb45938aa09fe28d39da61 100644 --- a/info.textgrid.middleware.tgauth.webauth/tglib/LDAP.class.php +++ b/info.textgrid.middleware.tgauth.webauth/tglib/LDAP.class.php @@ -21,10 +21,20 @@ class LDAP { protected $LDAPname; public $availableAttributes = array("o", "sn", "givenName", "cn", "mail"); public $AttributeMap = Array ('surname' => 'sn', - 'organisation' => 'o', +// StefanS will 'o' nicht User-Modifizierbar; daher wird +// es nur in RBAC und nicht in DARIAH LDAP geschrieben +// 'organisation' => 'o', 'givenname' => 'givenName', 'displayname' => 'cn', - 'mail' => 'mail'); + 'mail' => 'mail', + 'orgunit' => 'ou', + 'street' => 'street', + 'plz' => 'postalCode', + 'city' => 'l', + 'tel' => 'telephoneNumber', + 'interest' => 'dariahResearchInterests', + 'personid' => 'dariahResearcherId' + ); public function __construct( $configfilepath ) { $config = new DOMDocument(); @@ -42,6 +52,7 @@ class LDAP { $this->setAttributesDN = $xpath->query("/c:conf/c:authn[@type='community']/c:key[@name='setAttributesDN']")->item(0)->nodeValue; $this->setAttributesPW = $xpath->query("/c:conf/c:authn[@type='community']/c:key[@name='setAttributesPW']")->item(0)->nodeValue; + $this->IDattribute = explode ( ";", $this->IDattribute ); } public function authenticate ($login, $password) { @@ -65,7 +76,14 @@ class LDAP { $this->UserAttributes = ldap_get_attributes ($ldapconn , $entry); - $TGID = $this->UserAttributes[$this->IDattribute][0]; + foreach ( $this->IDattribute as $idattr ) { + if ( isset ( $this->UserAttributes[$idattr] ) ) { + $TGID = $this->UserAttributes[$idattr][0]; + break; + } + } + +// $TGID = $this->UserAttributes[$this->IDattribute][0]; return array("success" => TRUE, "TGID" => $TGID, "LDAPname" => $this->LDAPname); } @@ -85,6 +103,7 @@ class LDAP { return $rethash; } +// Users will be modified via DARIAH SelfService at a later stage public function setUserAttributes ($attrHash, $remote_user) { $arrModify = Array(); @@ -119,7 +138,13 @@ class LDAP { return array("success" => FALSE, "detail" => "Authentication failed, reason: " . ldap_error ($ldapconn)); } else { - $filter = "(". $this->IDattribute."=".$remote_user.")"; + + $filter = "(|"; + foreach ( $this->IDattribute as $idattr ) { + $filter .= "(". $idattr."=".$remote_user.")"; + } + $filter .= ")"; + $result = ldap_search( $ldapconn, $this->basedn, $filter); if ($result === FALSE ) { return array("success" => FALSE, diff --git a/info.textgrid.middleware.tgauth.webauth/tglib/RBAC.class.php b/info.textgrid.middleware.tgauth.webauth/tglib/RBAC.class.php index cf0156753275da4f9f90253692a8f196f7fe547f..a551fececb547c15f6b90223f3a75f2fffd71a1a 100644 --- a/info.textgrid.middleware.tgauth.webauth/tglib/RBAC.class.php +++ b/info.textgrid.middleware.tgauth.webauth/tglib/RBAC.class.php @@ -235,7 +235,7 @@ class RBAC { } catch (Soapfault $f) { return array("success" => FALSE, "rbachash" => $rbachash, - "detail" => "SOAP FAULT (authorizedRoles)!: " . $f->faultcode . " / " . $f->faultstring . " / " . $f->detail ); + "detail" => "SOAP FAULT (authorizedRoles)!: " . $f->faultcode . " / " . $f->faultstring . " / " . $f->getTraceAsString()); exit; } if (!isset($roleResponse->role)) {