Documentation ¶
Overview ¶
Implements authenticator.Password by making a BasicAuth call to a remote endpoint, and extracting user information from a JSON response.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(url string, mapper authapi.UserIdentityMapper) authenticator.Password
New returns an authenticator which will make a basic auth call to the given url.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator uses basic auth to make a request to a JSON-returning URL. A 401 status indicate failed auth. A non-200 status or the presence of an "error" key with a non-empty
value indicates an error: {"error":"Error message"}
A 200 status with an "id" key indicates success:
{"id":"userid"}
A successful response may also include name and/or email:
{"id":"userid", "name": "User Name", "email":"user@example.com"}
func (*Authenticator) AuthenticatePassword ¶
type RemoteError ¶
type RemoteError struct {
Error string
}
RemoteError holds error data returned from a remote authentication request
type RemoteUserData ¶
RemoteUserData holds user data returned from a remote basic-auth protected endpoint. These field names can not be changed unless external integrators are also updated.