alexa_request_verifier v0.1.0 AlexaRequestVerifier
AlexaRequestVerifier verifies an Amazon Alexa Skills request to a Pheonix server. T
the package can be installed by adding alexa_request_verifier
to your list of dependencies in mix.exs
:
def deps do [{:alexa_request_verifier, “~> 0.1.0”}] end
You will also need to modify your Endpoint.ex file by adding the JSONRawBody Parser as follows:
parsers: [AlexaRequestVerifier.JSONRawBodyParser, :urlencoded, :multipart, :json],
The parser is needed to collect the raw body of the request as that is needed to verify the signature.
Finally, you will need to add AlexaRequestVerifier as an application.
applications: […, :alexa_request_verifier]
Summary
Functions
takes a string and confirms URL is in scheme https, has a s3.amazonaws.com host, is port 443 and has a path starting with /echo.api/
Validates the cert checks for hostname, checks that the cert has a valid key, etc
Assuming :raw_body, :signing_cert, and signature header, it will verify the signature
given a Plug.Conn that has a valid Alexa request request/timestamp, it will confirm the timestamp is valid
Functions
takes a string and confirms URL is in scheme https, has a s3.amazonaws.com host, is port 443 and has a path starting with /echo.api/
Validates the cert checks for hostname, checks that the cert has a valid key, etc…
Assuming :raw_body, :signing_cert, and signature header, it will verify the signature