Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 939 Bytes

authentication-provider.md

File metadata and controls

20 lines (14 loc) · 939 Bytes

Authentication Provider

To build a new authentication provider, you need to implement the Auther interface, whose method will be called on the login page after the user has submitted their login data.

// Auther is the authentication interface.
type Auther interface {
    // Auth is called to authenticate a request.
    Auth(r *http.Request, s *users.Storage, root string) (*users.User, error)
}

After implementing the interface you should:

  1. Add it to auth directory.
  2. Add it to the configuration parser for the CLI.
  3. Add it to the authBackend.Get.

If you need to add more flags, please update the function addConfigFlags.