43 $this->logger = $DIC->logger()->auth();
45 $this->rbacAdmin = $DIC->rbac()->admin();
47 parent::__construct($credentials);
55 $this->server_host = (string) $this->
settings->get(
'soap_auth_server',
'');
56 $this->server_port = (string) $this->
settings->get(
'soap_auth_port',
'');
57 $this->server_uri = (string) $this->
settings->get(
'soap_auth_uri',
'');
58 $this->server_nms = (string) $this->
settings->get(
'soap_auth_namespace',
'');
59 $this->server_https = (bool) $this->
settings->get(
'soap_auth_use_https',
false);
60 $this->use_dot_net = (bool) $this->
settings->get(
'use_dotnet',
false);
62 $this->uri = $this->server_https ?
'https://' :
'http://';
65 if ($this->server_port > 0) {
68 if ($this->server_uri) {
72 require_once
'./webservice/soap/lib/nusoap.php';
85 $this->
getLogger()->error($e->getMessage());
90 $this->logger->info(
'Successfully authenticated user via SOAP: ' . $this->
getCredentials()->getUsername());
108 $this->logger->debug(sprintf(
109 'Login observer called for SOAP authentication request of ext_account "%s" and auth_mode "%s".',
113 $this->logger->debug(sprintf(
114 'Trying to find ext_account "%s" for auth_mode "%s".',
125 if (
'' === $internalLogin ||
false === $internalLogin) {
131 if ($this->use_dot_net) {
132 $soapAction = $this->server_nms .
'/isValidSession';
136 $valid = $this->client->call(
141 $nspref .
'new_user' => $isNewUser
147 if (
$valid[
'valid'] !==
true) {
159 } elseif (!$this->
settings->get(
'soap_auth_create_users')) {
169 $usrData[
'firstname'] =
$valid[
'firstname'];
170 $usrData[
'lastname'] =
$valid[
'lastname'];
171 $usrData[
'email'] =
$valid[
'email'];
172 $usrData[
'login'] = $internalLogin;
173 $usrData[
'passwd'] =
'';
177 if ($this->
settings->get(
'soap_auth_allow_local')) {
184 $usrData[
'auth_mode'] =
'soap';
186 $usrData[
'profile_incomplete'] = 1;
188 $userObj->assignData($usrData);
189 $userObj->setTitle($userObj->getFullname());
190 $userObj->setDescription($userObj->getEmail());
191 $userObj->setLanguage($this->
language->getDefaultLanguage());
194 $userObj->setTimeLimitUnlimited(1);
195 $userObj->setTimeLimitFrom(time());
196 $userObj->setTimeLimitUntil(time());
197 $userObj->setOwner(0);
199 $userObj->setActive(1);
200 $userObj->updateOwner();
201 $userObj->saveAsNew(
false);
202 $userObj->writePrefs();
204 $this->rbacAdmin->assignUser(
205 $this->
settings->get(
'soap_auth_user_default_role', 4),
209 if ($this->
settings->get(
'soap_auth_account_mail',
false)) {
211 $registrationSettings->setPasswordGenerationStatus(
true);
214 $registrationSettings,
219 ->withDirectRegistrationMode()
Interface of auth credentials.
const STATUS_AUTHENTICATION_FAILED
handleSoapAuth(ilAuthStatus $status)
static _generateLogin($a_login)
generate free login by starting with a default string and adding postfix numbers
static set($a_var, $a_val)
Set a value.
static _lookupId($a_user_str)
Lookup id by login.
__construct(ilAuthCredentials $credentials)
static generatePasswords($a_number)
Generate a number of passwords.
Class ilAuthProviderSoap.
getAuthenticatedUserId()
Get authenticated user id.
setTranslatedReason($a_reason)
Set translated reason.
setAuthenticatedUserId($a_id)
Base class for authentication providers (radius, ldap, apache, ...)
Standard interface for auth provider implementations.
Class ilAccountRegistrationMail.
setStatus($a_status)
Set auth status.
[nu]soapclient higher level class for easy usage.
doAuthentication(ilAuthStatus $status)
setReason($a_reason)
Set reason.
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
const STATUS_AUTHENTICATED
const USER_FOLDER_ID
Class ilObjUserFolder.
Auth status implementation.