use name of oauth app to identify auth token

Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
This commit is contained in:
Bjoern Schiessle 2017-05-12 16:41:12 +02:00 committed by Lukas Reschke
parent bb19b37097
commit 23b296b66e
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 10 additions and 2 deletions

View File

@ -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);