Skip to content
Permalink
Browse files

Userinfo Endpoint

  • Loading branch information...
Spomky committed Jun 13, 2018
1 parent 3445f4c commit 6a795ce51661ab1cc83d27ec5884392810240059
@@ -121,6 +121,7 @@ public function preProcess(Authorization $authorization): Authorization
);
$this->authorizationCodeRepository->save($authorizationCode);
$authorization = $authorization->withResponseParameter('code', $authorizationCodeId->getValue());
$authorization->getMetadata()->with('authorization_code_id', $authorizationCode->getAuthorizationCodeId()->getValue());
return $authorization;
}
@@ -88,6 +88,7 @@ public function preProcess(Authorization $authorization): Authorization
*/
public function process(Authorization $authorization): Authorization
{
$additionalInformation = $authorization->getTokenType()->getAdditionalInformation();
$accessTokenId = $this->accessTokenIdGenerator->createAccessTokenId(
$authorization->getUserAccount()->getUserAccountId(),
$authorization->getClient()->getClientId(),
@@ -100,13 +101,16 @@ public function process(Authorization $authorization): Authorization
$accessTokenId,
$authorization->getUserAccount()->getUserAccountId(),
$authorization->getClient()->getClientId(),
DataBag::create($authorization->getTokenType()->getAdditionalInformation()),
DataBag::create($additionalInformation),
$authorization->getMetadata(),
new \DateTimeImmutable(sprintf('now +%d seconds', $this->accessTokenLifetime)),
null
);
$this->accessTokenRepository->save($accessToken);
foreach ($additionalInformation as $k => $v) {
$authorization = $authorization->withResponseParameter($k, $v);
}
foreach ($accessToken->getResponseData() as $k => $v) {
$authorization = $authorization->withResponseParameter($k, $v);
}
@@ -83,8 +83,8 @@ public function getResponseMode(): string
public function preProcess(Authorization $authorization): Authorization
{
$authorization = $this->codeResponseType->preProcess($authorization);
$authorization = $this->tokenResponseType->preProcess($authorization);
$authorization = $this->idTokenResponseType->preProcess($authorization);
$authorization = $this->tokenResponseType->preProcess($authorization);
return $authorization;
}
@@ -95,8 +95,8 @@ public function preProcess(Authorization $authorization): Authorization
public function process(Authorization $authorization): Authorization
{
$authorization = $this->codeResponseType->process($authorization);
$authorization = $this->tokenResponseType->process($authorization);
$authorization = $this->idTokenResponseType->process($authorization);
$authorization = $this->tokenResponseType->process($authorization);
return $authorization;
}
@@ -73,8 +73,8 @@ public function getResponseMode(): string
*/
public function preProcess(Authorization $authorization): Authorization
{
$authorization = $this->tokenResponseType->preProcess($authorization);
$authorization = $this->idTokenResponseType->preProcess($authorization);
$authorization = $this->tokenResponseType->preProcess($authorization);
return $authorization;
}
@@ -84,8 +84,8 @@ public function preProcess(Authorization $authorization): Authorization
*/
public function process(Authorization $authorization): Authorization
{
$authorization = $this->tokenResponseType->process($authorization);
$authorization = $this->idTokenResponseType->process($authorization);
$authorization = $this->tokenResponseType->process($authorization);
return $authorization;
}

0 comments on commit 6a795ce

Please sign in to comment.
You can’t perform that action at this time.