Skip to main content

Command Palette

Search for a command to run...

Serverless Authentication with Golang

Updated
Serverless Authentication with Golang
N

HI there 馃憢

I'm Nir Adler, and I'm a Developer, Hacker and a Maker, you can start with me a conversation on any technical subject out there, you will find me interesting.

Almost every project needs authentication to serve secure user content.

For most of my side projects, I prefer to pay per use for cost optimization.

continuing my experiment with Golang, I created Golang service that's going to run inside AWS Lambda function and store the data in Dynmodb database, I'm using serverless AWS services to fulfil my requirement of cost optimize service.

GitHub repo

Features

  • Email/password login

  • Forgot password

  • Provider login using google/github and more

  • Multi tenant(orgs)

  • Store user data on signup

  • Basic roles

  • Invite users

  • Emails template

  • JWT

Supported routes:

methodroutepayloadRolepublicdescription
POST/v1/auth/loginemail, passwordtrueLogin
POST/v1/auth/login/emailemailtruePasswordless Login
POST/v1/auth/signupemail, password, datatrueSignup
GET/v1/auth/validatetrueValidateToken
POST/v1/auth/renewfalseGet new Token
GET/v1/auth/provider/:providertrueLogin with provider
GET/v1/auth/provider/:provider/callbacktrueValidate provider login
GET/v1/users/metrueHealth check
PUT/v1/users/medatafalseUpdate user data
PUT/v1/users/me/passwordpassword,repeated passwordfalseUpdate user password
POST/v1/orgsnamefalseCreate Org
POST/v1/orgs/:orgId/inviteemail, roleadminfalseInvite user to me org
GET/v1/orgs/:orgId/usersadminfalseGet org users

More from this blog

P

Piece by Piece

46 posts

Hi 馃憢, let me share a story with you. I don't want to overwhelm you, so I'm serving this story piece by piece.