summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2017-05-12 16:41:12 +0200
committerLukas Reschke <lukas@statuscode.ch>2017-05-18 20:49:07 +0200
commit23b296b66eaf674d8eac4b00b044c1dfeda53014 (patch)
tree3eb19601ff8043cb2c817efdaee993d1cb003ab8 /core
parentbb19b3709706b49cdae65c77d28ab89ad3679951 (diff)
downloadnextcloud-server-23b296b66eaf674d8eac4b00b044c1dfeda53014.tar.gz
nextcloud-server-23b296b66eaf674d8eac4b00b044c1dfeda53014.zip
use name of oauth app to identify auth token
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'core')
-rw-r--r--core/Controller/ClientFlowLoginController.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/Controller/ClientFlowLoginController.php b/core/Controller/ClientFlowLoginController.php
index 996ae34b0f2..b41a29dc1c4 100644
--- a/core/Controller/ClientFlowLoginController.php
+++ b/core/Controller/ClientFlowLoginController.php
@@ -271,6 +271,14 @@ class ClientFlowLoginController extends Controller {
return $response;
}
+ $clientName = $this->getClientName();
+ $oAuthClient = false;
+ if($clientIdentifier !== '') {
+ $client = $this->clientMapper->getByIdentifier($clientIdentifier);
+ $clientName = $client->getName();
+ $oAuthClient = true;
+ }
+
$token = $this->random->generate(72, ISecureRandom::CHAR_UPPER.ISecureRandom::CHAR_LOWER.ISecureRandom::CHAR_DIGITS);
$uid = $this->userSession->getUser()->getUID();
$generatedToken = $this->tokenProvider->generateToken(
@@ -278,12 +286,12 @@ class ClientFlowLoginController extends Controller {
$uid,
$loginName,
$password,
- $this->getClientName(),
+ $clientName,
IToken::PERMANENT_TOKEN,
IToken::DO_NOT_REMEMBER
);
- if($clientIdentifier !== '') {
+ if($oAuthClient) {
$client = $this->clientMapper->getByIdentifier($clientIdentifier);
$code = $this->random->generate(128);