If you have a django backend/admin portal this module allows for the connection of you application to the django backend
authentication and authorisation system.
We use the sessionid cookie from the django sessions table to authenticate/authorise
request coming into the gin router.
- Secure Gin routes with a Django session cookie
- Adding login handler to create session on the django server
- Support for multiple flavours of sql database
go get github.com/dowling-john/gin_django_auth
GINDJANGOAUTHDBCONNECTIONSTRING : "postgres://<username>:<password>@<host>:5432/<db>?sslmode=disable"
GINDJANGOAUTHDBDIALECT: "postgres"
GINDJANGOAUTHSIGNINGKEY: "django-insecure-2z74-f1&^1xqaiw4!9^32^c*(9zr-zs1y5w2j9dlftb4@rz_f5"
import (
"github.com/Flexin1981/gin_django_auth/middleware"
)
router.POST("/graphql", middleware.LoginRequired, handlers.GraphQlHandler)
import (
"github.com/Flexin1981/gin_django_auth/handlers"
)
router.POST("/login", handlers.DjangoLoginHandler)