protected function LTIToolProvider::sendLtiError in LTI Tool Provider 2.x
Same name and namespace in other branches
- 8 src/Authentication/Provider/LTIToolProvider.php \Drupal\lti_tool_provider\Authentication\Provider\LTIToolProvider::sendLtiError()
Send an error back to the LMS.
Parameters
string $message: The error message to send.
2 calls to LTIToolProvider::sendLtiError()
- LTIToolProvider::authenticate in src/
Authentication/ Provider/ LTIToolProvider.php - Authenticates the user.
- LTIToolProvider::provisionUser in src/
Authentication/ Provider/ LTIToolProvider.php - Provision a user that matches the LTI request context info.
File
- src/
Authentication/ Provider/ LTIToolProvider.php, line 256
Class
- LTIToolProvider
- Oauth authentication provider for LTI Tool Provider.
Namespace
Drupal\lti_tool_provider\Authentication\ProviderCode
protected function sendLtiError(string $message) {
if (isset($this->context['launch_presentation_return_url']) && !empty($this->context['launch_presentation_return_url'])) {
$url = Url::fromUri($this->context['launch_presentation_return_url'])
->setOption('query', [
'lti_errormsg' => $message,
])
->setAbsolute(TRUE)
->toString();
$response = new RedirectResponse($url);
$response
->send();
}
}