mirror of
https://github.com/netzbegruenung/user_saml.git
synced 2024-05-04 10:03:42 +02:00
we need to store some basic user information, even in the global scale scenario
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
parent
9b20d24c72
commit
b80b94e408
|
@ -33,7 +33,8 @@ While theoretically any other authentication provider implementing either one of
|
||||||
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png</screenshot>
|
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/1.png</screenshot>
|
||||||
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png</screenshot>
|
<screenshot>https://raw.githubusercontent.com/nextcloud/user_saml/master/screenshots/2.png</screenshot>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<nextcloud min-version="15" max-version="15" />
|
<lib>mcrypt</lib>
|
||||||
|
<nextcloud min-version="14" max-version="15" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<settings>
|
<settings>
|
||||||
<admin>OCA\User_SAML\Settings\Admin</admin>
|
<admin>OCA\User_SAML\Settings\Admin</admin>
|
||||||
|
|
|
@ -100,11 +100,6 @@ class SAMLController extends Controller {
|
||||||
*/
|
*/
|
||||||
private function autoprovisionIfPossible(array $auth) {
|
private function autoprovisionIfPossible(array $auth) {
|
||||||
|
|
||||||
// nothing to do here, in case of a global scale setup
|
|
||||||
if ($this->config->getSystemValue('gs.enabled', false)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
$prefix = $this->SAMLSettings->getPrefix();
|
$prefix = $this->SAMLSettings->getPrefix();
|
||||||
$uidMapping = $this->config->getAppValue('user_saml', $prefix . 'general-uid_mapping');
|
$uidMapping = $this->config->getAppValue('user_saml', $prefix . 'general-uid_mapping');
|
||||||
if(isset($auth[$uidMapping])) {
|
if(isset($auth[$uidMapping])) {
|
||||||
|
@ -120,6 +115,11 @@ class SAMLController extends Controller {
|
||||||
throw new \InvalidArgumentException('No valid uid given, please check your attribute mapping. Given uid: ' . $uid);
|
throw new \InvalidArgumentException('No valid uid given, please check your attribute mapping. Given uid: ' . $uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// in case of a global scale setup we make sure that the server knows the user and leave
|
||||||
|
if ($this->config->getSystemValue('gs.enabled', false)) {
|
||||||
|
$this->userBackend->createUserIfNotExists($uid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
$userExists = $this->userManager->userExists($uid);
|
$userExists = $this->userManager->userExists($uid);
|
||||||
$autoProvisioningAllowed = $this->userBackend->autoprovisionAllowed();
|
$autoProvisioningAllowed = $this->userBackend->autoprovisionAllowed();
|
||||||
if($userExists === true) {
|
if($userExists === true) {
|
||||||
|
@ -265,7 +265,7 @@ class SAMLController extends Controller {
|
||||||
$this->session->set('user_saml.samlSessionExpiration', $auth->getSessionExpiration());
|
$this->session->set('user_saml.samlSessionExpiration', $auth->getSessionExpiration());
|
||||||
try {
|
try {
|
||||||
$user = $this->userManager->get($this->userBackend->getCurrentUserId());
|
$user = $this->userManager->get($this->userBackend->getCurrentUserId());
|
||||||
if(!($user instanceof IUser)) {
|
if (!($user instanceof IUser)) {
|
||||||
throw new \InvalidArgumentException('User is not valid');
|
throw new \InvalidArgumentException('User is not valid');
|
||||||
}
|
}
|
||||||
$user->updateLastLoginTimestamp();
|
$user->updateLastLoginTimestamp();
|
||||||
|
|
Loading…
Reference in a new issue