Skip to content
Golang interface for authentication backends
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
authbackend
.gitignore
AUTHORS
CONTRIBUTING.md
LICENSE
README.md

README.md

go-auth-backend

Description

go-auth-backend contains a simple interface for building authentication plugins for Go servers.

Building

go get github.com/spatialcurrent/go-auth-backend

Usage

Server

backend, err := LoadFromPlugin("/path/to/custom/auth/plugin.so", "NewAuthenticationBackend")

Plugin

package main

import (
  "net/http"
)

import (
  "github.com/spatialcurrent/go-auth-backend/authbackend"
)

func NewAuthenticationBackend() authbackend.Backend {
  return &MyCustomAuthBackend{}
}

func (a *AuthenticationBackend) Type() string {
  return "My Custom Auth Backend"
}

func (a *AuthenticationBackend) Connect(options map[string]string) (error) {
...
}

func (a *AuthenticationBackend) AuthenticateRequest(r *http.Request) (bool, authbackend.User, authbackend.Team, error) {
...
}

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

You can’t perform that action at this time.