GoBuffalo and Authboss (authentication system) integration

I’m trying to use authboss (https://github.com/volatiletech/authboss) with GoBuffalo (https://github.com/gobuffalo/buffalo).

I’m still learning Go and I think this is a good exercise.

I created a new GoBuffalo app, you can find it here: https://github.com/frederikhors/buffalo-authboss-sample

STEPS TO REPRODUCE

  • git clone https://github.com/frederikhors/buffalo-authboss-sample

  • cd in project root

  • go get -u -v github.com/gobuffalo/buffalo/buffalo

  • go mod tidy

  • buffalo dev

As you can see the new buffalo app is minimal (all the features are commented).

I copied a very small set of instructions from this sample repo: https://github.com/volatiletech/authboss-sample

The app starts but I can’t open http://localhost:3000/auth/login (404 page not found).

Using app.Mount("/auth", http.StripPrefix("/auth", ab.Config.Core.Router)) creates routes as you can see in dashboard (http://localhost:3000/) or in the screen below.

Buffalo routes:

GET     /auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1
PUT     /auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1
PATCH	/auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1
HEAD	/auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1
OPTIONS	/auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1
DELETE	/auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1
POST	/auth/{path:.+}/	authPath	github.com/gobuffalo/buffalo.WrapHandler.func1

I can’t understand how to tell Buffalo to render authboss views for that routes.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.