laardee / serverless-authentication-boilerplate

Generic authentication boilerplate for Serverless framework
http://laardee.github.io/serverless-authentication-gh-pages
MIT License
569 stars 72 forks source link

Test-token folder sls deploy not finding authorizer arn #38

Closed quantuminformation closed 7 years ago

quantuminformation commented 7 years ago

I am trying to sun sls deploy on the test-token folder but am getting

- Function not found: arn:aws:lambda:us-east-1:180971085012:function:uz4g3f3m8i.

previously I Installed the authentication sls and got

  GET - https://uz4g3f3m8i.execute-api.us-east-1.amazonaws.com/dev/authentication/signin/{provider}
  GET - https://uz4g3f3m8i.execute-api.us-east-1.amazonaws.com/dev/authentication/callback/{provider}
  GET - https://uz4g3f3m8i.execute-api.us-east-1.amazonaws.com/dev/authentication/refresh/{refresh_token}

Any ideas what else I can try?

laardee commented 7 years ago

Hi @QuantumInformation, the last part should be something like serverless-authentication-dev-authorize, where serverless-authentication is the service name you have defined in authentication service, dev is the stage and authorize is the name of the authorize function. arn:aws:lambda:us-east-1:180971085012:function:serverless-authentication-dev-authorize

The function name should also be displayed after those endpoint when you deploy the authentication service or run sls info in authentication service root directory.

quantuminformation commented 7 years ago

What I tried was: image

laardee commented 7 years ago

ok, can you run the sls info in the authentication directory? It should display the name of the authorizer function.

The output something like this:

Service Information
service: dev-auth
stage: dev
region: eu-central-1
api keys:
  None
endpoints:
  GET - https://**********.execute-api.eu-central-1.amazonaws.com/dev/authentication/signin/{provider}
  GET - https://**********.execute-api.eu-central-1.amazonaws.com/dev/authentication/callback/{provider}
  GET - https://**********.execute-api.eu-central-1.amazonaws.com/dev/authentication/refresh/{refresh_token}
functions:
  signin: dev-auth-dev-signin
  callback: dev-auth-dev-callback
  refresh: dev-auth-dev-refresh
  authorize: dev-auth-dev-authorize
  schema: dev-auth-dev-schema

The authorize function name in my case is dev-auth-dev-authorize which can be found from functions -> authorize. Take that name and add it to the authorizer arn arn:aws:lambda:region:your-account-id:function:dev-auth-dev-authorize

quantuminformation commented 7 years ago

Cool thanks

quantuminformation commented 7 years ago

Why did you decide to split the serverless.yml into two?