-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Amazon validation...again :) #15
base: master
Are you sure you want to change the base?
Conversation
… parsed to ensure that has been made by Amazon. This step is needed to pass the first automatic step of the skill certification done by Amazon.
…t and its configurations because mockery conflicts with it.
Should this be working now? I am getting "The skill end-point is not validating the signatures for incoming requests and is accepting requests with an invalid signature URL specified. Please make sure that your signature validation is correct." |
@Corlett for what i have tested it works 😄 Have you taken the right branch and configured the driver with the the skill id and a boolean to enable the validation? |
Lol, I'm sure it's user error then. I just did "php artisan botman:install-driver amazon-alexa". Where do I set the skill ID and boolean? |
Ok 😄 my pull request with the Amazon validation is still open and has not been merged, so you won't find it in the master branch. Untill it is not merged, you can find it in my fork. About the configuration, when using a driver you can pass additional configuration to it. In this driver there are no configurations besides the ones that I have introduced, but you can check the official documentation for the Telegram driver to get the point. The keys to use are "enableValidation" (bool), and "skillId" (string, the skill ID from the Amazon developer portal). |
@dottxado I'm sorry I thought is made sense, but I seem to be missing something that's probably pretty basic. Can you share relative path to the file that you placed your configuration variables in and how your json looks? |
@Corlett I don't use Laravel or Botman Studio, but I will try to help. Into /config/botman/config.php I think you need to have 'amazon-alexa' => [
'enableValidation' => true,
'skillId' => 'amzn1.ask.skill-ID',
], You may also find the tests in my branch, so you can also check your configurations with them. |
hmm... I gave that a try but it didn't change anything. I also tried creating the file amazon-alexa.php in the same directory. Now Alexa only replies with, "There was a problem with the requested skills response." Perhaps I need to ditch botman studio. where did you place the for your setup? |
@dottxado, I would be happy to pay you for a video walk through on how to get this setup from start to finish. |
@Corlett ok, great! I've just managed to make it work on a Botman Studio instance, and before doing anything I have to add to the instructions the fact that the developer needs to manage and exception (AmazonValidationException) to return 400 to the Amazon service, or the skill certification won't pass the automated tests. But from what i can see your problems are not at that level, so I'm going to make the video for you (and I'll also demonstrate how to manage the exception). How can I contact you to send the video? |
@dottxado, that is great news! I just sent you a message with my contact info on LinkedIn. |
Added all the necessary to pass the automatic validation done by the Alexa developer portal when requesting the skill certification to go out in production.
The Alexa developer portal enforces some security practices that the skill must do to check that the request is really coming from Amazon, otherwise the skill must return a 400 response. In order to configure this new feature, the skill developer has to add to the config array of the driver:
The enablement is a way to develop the skill without falling into the checks: disable the validation and the skill will act as usual accepting every request, enable the validation and all the messages will be filtered to do the required checks. One of these required checks is on the skill id (given by the Alexa developer portal), so if the validation is enabled the developer must also add the skill id to the configurations.
To manage the case in which the request is not valid, I added an exception without catching it, because it will be the developer of the skill to manage that particular exception in his framework, do what he wants and return a response of 400 to the client. For example, i work with Symfony and i can add an handler on the "Exception" kernel event and manage the response.
Just tested with the Alexa developer portal and found 0 errors :)
I've also bumped the phpunit version, because mockery seems to conflit with version beneath the 9.
Sorry for the mess i've made with the previous PR.