/** * {@inheritdoc} */ public function prepareAuthorization(AuthorizationInterface $authorization) { $token_type = $this->getTokenTypeFromRequest($authorization->getQueryParams()); $token = $this->getAccessTokenManager()->createAccessToken($authorization->getClient(), $authorization->getUserAccount(), $token_type->getTokenTypeInformation(), $authorization->getQueryParams(), $authorization->getScopes(), null, null, ['redirect_uri' => $authorization->getQueryParam('redirect_uri')]); $authorization->setData('access_token', $token); foreach ($this->listeners as $listener) { $listener->call($token); } return []; }
/** * {@inheritdoc} */ public function prepareAuthorization(AuthorizationInterface $authorization) { $token_type = $this->getTokenTypeFromRequest($authorization->getQueryParams()); $token = $this->getAccessTokenManager()->createAccessToken($authorization->getClient(), $authorization->getUserAccount(), $token_type->getTokenTypeInformation(), $authorization->getQueryParams(), $authorization->getScopes(), null, null, ['redirect_uri' => $authorization->getRedirectUri()]); $authorization->setData('access_token', $token); return $token->toArray(); }