Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Basic ¶
*
- Perform authentication. *
- Params:
- - realm (string): The name of the realm. (Default: "web")
- - datasource (string): The name of the datasource that should be used to authenticate.
- This datasource must be an `auth.UserDatasource`. (Default: "auth.UserDatasource") *
- Context:
- - http.Request (*http.Request): The HTTP request. This is usually placed into the
- context for you.
- - http.ResponseWriter (http.ResponseWriter): The response. This is usually placed
- into the context for you. *
- Datasource:
- - An auth.UserDatasource. By default, this will look for a datasource named
- "auth.UserDatasource". This can be overridden by the `datasource` param. *
- Returns:
- - True if the user authenticated. If not, this will send a 401 and then stop
- the current chain.
Types ¶
type UserDatasource ¶
Authenticate a username/password pair.
This expects a username and a password as strings. A boolean `true` indicates that the user has been authenticated. A `false` indicates that the user/password combo has failed to auth. This is not necessarily an error. An error should only be returned when an unexpected condition has obtained during authentication.
Click to show internal directories.
Click to hide internal directories.