request = $request; } /** * @return common_user_User|LtiProviderUser * @throws LisAuthAdapterException */ public function authenticate() { $oauthService = $this->getLisOauthService(); try { /** @var LisOAuthConsumer $oauthConsumer */ [$oauthConsumer, $token] = $oauthService->validatePsrRequest($this->request); } catch (common_http_InvalidSignatureException | LockOutException $exception) { // to meet interface requirement throw new LisAuthAdapterException( $exception->getMessage(), $exception->getCode(), $exception ); } return new LtiProviderUser($oauthConsumer->getLtiProvider()); } /** * @return LisOauthService */ private function getLisOauthService() { /** @noinspection PhpIncompatibleReturnTypeInspection */ return $this->getServiceLocator()->get(LisOauthService::SERVICE_ID); } }