Also update timestamp for environment variable auth

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-08-04 18:19:34 +02:00
parent bae5f79cbd
commit a1986b46b0
No known key found for this signature in database
GPG key ID: B9F6980CF6E759B1
2 changed files with 7 additions and 0 deletions

View file

@ -141,6 +141,11 @@ class SAMLController extends Controller {
$this->session->set('user_saml.samlUserData', $_SERVER);
try {
$this->autoprovisionIfPossible($this->session->get('user_saml.samlUserData'));
$user = $this->userManager->get($this->userBackend->getCurrentUserId());
if(!($user instanceof IUser)) {
throw new NoUserFoundException();
}
$user->updateLastLoginTimestamp();
} catch (NoUserFoundException $e) {
$ssoUrl = $this->urlGenerator->linkToRouteAbsolute('user_saml.SAML.notProvisioned');
}

View file

@ -7,6 +7,7 @@ Feature: EnvironmentVariable
When I send a GET request to "http://localhost/index.php/login"
Then I should be redirected to "http://localhost/index.php/apps/files/"
Then The user value "id" should be "not-provisioned-user"
And The last login timestamp of "not-provisioned-user" should not be empty
Scenario: Authenticating using environment variable with SSO and successful check if user exists on backend
Given A local user with uid "provisioned-user" exists
@ -17,6 +18,7 @@ Feature: EnvironmentVariable
When I send a GET request to "http://localhost/index.php/login"
Then I should be redirected to "http://localhost/index.php/apps/files/"
Then The user value "id" should be "provisioned-user"
And The last login timestamp of "provisioned-user" should not be empty
Scenario: Authenticating using environment variable with SSO and unsuccessful check if user exists on backend
Given The setting "type" is set to "environment-variable"