Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Cant find file to Sign JWT with private.key #7

Open
jdmevo123 opened this issue Mar 23, 2018 · 0 comments
Open

Cant find file to Sign JWT with private.key #7

jdmevo123 opened this issue Mar 23, 2018 · 0 comments

Comments

@jdmevo123
Copy link

Hi,

I can successfully sign a JW with private key locallay running serverless-offline, however when I push up to Lambda, I get the following:

Error: ENOENT: no such file or directory, open 'private.key'
at Error (native)
at Object.fs.openSync (fs.js:549:18)
at Object.fs.readFileSync (fs.js:397:15)
at Object.r.createToken (/var/task/auth/users/post/_serverless_handler.js:1:1561)
at /var/task/auth/users/post/_serverless_handler.js:1:2912
at /var/task/auth/users/post/_serverless_handler.js:1:1406
at /var/task/auth/users/post/_serverless_handler.js:5:3758
at f (/var/task/auth/users/post/_serverless_handler.js:5:9015)
at c.respond (/var/task/auth/users/post/_serverless_handler.js:5:11093)
at c.responseHandler (/var/task/auth/users/post/_serverless_handler.js:5:12239)

Now I know the code works, its more the path I guess on where to find the key. In this scenario, I placed the key under /auth/lib/* and the reference is for the key is called in the token.js in the same folder via:

var secretTokenPriv = fs.readFileSync('private.key'); // get private key

Do you have any ideas? Im stuck and have been rattling my brain for two days with different combinations ect and cannot seem to get the file to be found.

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant