A simple Serverless auth API.
yarn
yarn deploy
AWS_PROFILE
STAGE
JWT_SECRET_KEY
export AWS_PROFILE="it-is-me"
export STAGE="production"
export JWT_SECRET_KEY="something-very-complex-secret-key"
Request:
POST /simple
{
"name": string;
"email": string | undefined;
"application": string;
}
Response: JWT({name}, 1h)
Request example with cURL.
$ curl -XPOST https://API.DOMAIN.TLD/simple -d '{"name":"lacti","email":"[email protected]","application":"test"}'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoibGFjdGkiLCJlbWFpbCI6ImxhY3RyaW91c0BnbWFpbC5jb20iLCJhcHBsaWNhdGlvbnMiOlsidGVzdCJdLCJpYXQiOjE2MjEwNDQyNDIsImV4cCI6MTYyMTA0Nzg0Mn0.SECRET_ENCODED
Request:
POST /google
{
"token": string;
"application": string;
}
Response: JWT({name, email}, 7d)
Request example with cURL.
$ curl -XPOST https://API.DOMAIN.TLD/google -d '{"token":"GOOGLE_AUTH_TOKEN","application":"test"}'
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.PAYLOAD_ENCODED.SECRET_ENCODED