serverless-alexa-skills icon indicating copy to clipboard operation
serverless-alexa-skills copied to clipboard

alexa auth command not working

Open goldytech opened this issue 6 years ago • 8 comments

Hi, In AWS Security profile following are my settings

Allowed Origins  
http://127.0.0.1:9000/
Allowed Return URLs  
http://127.0.0.1:9000/cb

now when I run the command sls alexa auth. I don't see any listener process / webserver getting started which listens on 9000 port.

Hence after the Amazon consent screen The redirect uri not working in browser. I've been following this link https://medium.com/@rupakg/how-to-build-a-serverless-alexa-skill-51d8479e0432 to build my custom skill.

Please help

goldytech avatar Nov 20 '18 08:11 goldytech

+1 same problem

brunotag avatar Nov 23 '18 13:11 brunotag

@goldytech it must be related with the versions 1.33.x of the serverless package: they must have changed the way they load/unload the plugins, or something like that - basically the command is terminated and the server is killed too early.

Workaround: npm install -g [email protected]

that should make sls alexa auth work afterwards (at least, it worked for me, node version 8.10).

brunotag avatar Nov 23 '18 14:11 brunotag

ok, my guess is that this fix https://github.com/serverless/serverless/pull/5349 is actually breaking the sls alexa auth command for serverless 1.33.x.

Ironic :)

brunotag avatar Nov 23 '18 15:11 brunotag

Yup, locally tested. If you wanna give it a shot, install serverless 1.33.x, open the node_modules/serverless/bin/serverless file, delete this line https://github.com/serverless/serverless/blob/master/bin/serverless#L45 and you'll see sls alexa auth waiting for the connection.

brunotag avatar Nov 23 '18 15:11 brunotag

@marcy-terui, to fix this, make the command that's getting killed return a promise that doesn't resolve until the work is done. See serverless/serverless#5503 for how I fixed sls log being broken by the same change.

dschep avatar Nov 23 '18 23:11 dschep

An imperfect but easy to implement fix could be adding a .delay(someTensOfSeconds) at the end of this chain of then's. https://github.com/marcy-terui/serverless-alexa-skills/blob/master/index.js#L152

brunotag avatar Nov 24 '18 06:11 brunotag

Any update to this? I'm still seeing the issue with the latest version of serverless. @dschep I tried your fix by trying to install the fix, but the branch has been deleted.

Stackclash avatar Feb 19 '19 20:02 Stackclash

+1 same problem

zaunermax avatar Mar 24 '19 21:03 zaunermax