LTI v0.1.0 LTIResult View Source

Module to handle incoming HTTP requests from LTI Providers

Link to this section Summary

Functions

Determines a signature using the HTTP method of the request, the url of the application’s endpoint used by the providers to send the request, the oauth parameters used to construct the base string, and the secret of the corresponding LTI provider. The parameters are expected to be a list of tuples containing a key and corresponding value. The result is a percent encoded signature

Link to this section Functions

Link to this function signature(url, oauth_header, secret) View Source

Determines a signature using the HTTP method of the request, the url of the application’s endpoint used by the providers to send the request, the oauth parameters used to construct the base string, and the secret of the corresponding LTI provider. The parameters are expected to be a list of tuples containing a key and corresponding value. The result is a percent encoded signature.

Examples

iex(0)> LTIResult.signature(
iex(0)>   "https://example.com",
iex(0)>   ~S"OAuth oauth_consumer_key="key1234",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1525076552",oauth_nonce="123",oauth_version="1.0",oauth_signature="iyyQNRQyXTlpLJPJns3ireWjQxo%3D"",
iex(0)>   "random_secret"
iex(0)> )
{:ok, "iyyQNRQyXTlpLJPJns3ireWjQxo%3D"}