Is This Auth Stack Satisfactory?

Hello,

A year ago I received some great advice, when I was in the early research stages of my company’s project, from @Dean_Davidson and other memebrs of hte community ( Crazy to use Go in a CRUD App - #10 ) I appreciate it, and wouldn’t have made it this far without everyone who contributed on that thread.

The database schema is built, and I’ve wrote most of the Go + Echo backend. I originally was going to use Supabase to manage Postgres & Auth, but we host on our own servers (Supabase is a bloated stack), and the more I got comfortable with Postgres, I decided to ditch it before we get to production.

Unfortuantely, that means I need to manage Authentication. The only authentication I want available for the application is Google or Microsoft SSO. For the sake of simplicity, **is this auth stack satisfactory?

go get github.com/markbates/goth
go get github.com/gorilla/sessions
go get github.com/golang-jwt/jwt/v5
go get github.com/labstack/echo-jwt/v4

Current project structure:

laneweavertms
├── cmd
│ └── server
├── internal
│ ├── config
│ ├── database
│ ├── dbtypes
│ ├── handlers
│ ├── middleware
│ ├── models
│ ├── repository
│ ├── router
│ ├── services
│ └── validators
├── laneweaver-frontend
│ ├── e2e
│ └── src
│ ├── lib
│ │ ├── assets
│ │ ├── components
│ │ ├── types
│ │ └── utils
│ └── routes
├── scripts
└── postgresql
├── backups
└── migrations
└── _archived

Thank you in advance. I appreciate it.

Glad you are continuing to make progress! That looks fine to me. But as usual, the devil is in the details. But as long as you followed the goth docs and got Google/Microsoft SSO set up properly you should be good.

2 Likes

Thanks, dude.

Just got done building it it. Was a lot easier than I figured it would be, but I haven’t tested it yet, so we’ll see. lol

Oh ya, regarding the API spec, there’s so many packages to choose from. Swaggo, oapi-codegen, Fuego, etc;

Any recommendations?

There are whole classes of problems that don’t manifest until you are running at scale. Also - testing usually uncovers a lot of stuff.

I don’t have a lot of experience with those options. Go with whatever fits your project! All of them seem to have healthy repositories with contributors, etc.

1 Like