From: Bjoern Schiessle Date: Fri, 12 May 2017 14:41:12 +0000 (+0200) Subject: use name of oauth app to identify auth token X-Git-Tag: v12.0.0RC1~3^2~21 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=23b296b66eaf674d8eac4b00b044c1dfeda53014;p=nextcloud-server.git use name of oauth app to identify auth token Signed-off-by: Bjoern Schiessle --- 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);