MiniCodeMonkey / amazon-alexa-php

Amazon Alexa PHP Library
99 stars 70 forks source link

Add Certification Validation #3

Open TSGames opened 7 years ago

TSGames commented 7 years ago

I've used this library to successfully publishing a skill in the store. For this, I've added full validation and modified response status to 400 on Exception. Furthermore, I've also reduced the timestamp validation time to 15 seconds, I'm not sure if it's required but with this modification amazon has acceppted the skill. Attached you find my modified Request.php, may you want to push it into the library., I'm too lazy to setup git ;)

Thanks for providing this library and Regards :)

Request.zip

pattyland commented 7 years ago

Hey, you could simply click on "Fork this project and edit the file"! Than you could submit your changes and create a pull request without installing any git client ;)

TSGames commented 7 years ago

Thanks, I've done so ;)

pattyland commented 7 years ago

I don't see it right now: https://github.com/MiniCodeMonkey/amazon-alexa-php/pulls

TSGames commented 7 years ago

I forked it away, it says pull requests are not allowed here.

Philipowitsch commented 7 years ago

Great job! Thanks. Saved me a lot of time.

Only changes necessary for me:

55: $url=getallheaders()["Signaturecertchainurl"];
-> $url=getallheaders()["SignatureCertChainUrl"];

+

48: $valid&=$url["port"]==443 || $url["port"]==null;
-> $valid&=(!isset($url["port"])) || (isset($url["port"]) && ($url["port"]==443 || $url["port"]==null));

+

Added above 79: date_default_timezone_set('UTC');