Documentation ¶
Index ¶
Constants ¶
View Source
const (
// MaxHTTPBodySize defines max http body size
MaxHTTPBodySize = 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectHandler ¶
type DirectHandler struct { logger.L ProviderName string TokenService provider.TokenService Issuer string AvatarSaver provider.AvatarSaver CredChecker ICredChecker }
DirectHandler implements non-oauth2 provider authorizing user in traditional way with storage with users and hashes
func (DirectHandler) AuthHandler ¶
func (p DirectHandler) AuthHandler(w http.ResponseWriter, r *http.Request)
AuthHandler doesn't do anything for direct login as it has no callbacks
func (DirectHandler) LoginHandler ¶
func (p DirectHandler) LoginHandler(w http.ResponseWriter, r *http.Request)
LoginHandler checks "user" and "passwd" against data store and makes jwt if all passed.
GET /something?user=name&passwd=xyz&aud=bar&sess=[0|1]
POST /something?sess[0|1] Accepts application/x-www-form-urlencoded or application/json encoded requests.
application/x-www-form-urlencoded body example: user=name&passwd=xyz&aud=bar
application/json body example:
{ "user": "name", "passwd": "xyz", "aud": "bar", }
func (DirectHandler) LogoutHandler ¶
func (p DirectHandler) LogoutHandler(w http.ResponseWriter, r *http.Request)
LogoutHandler - GET /logout
Click to show internal directories.
Click to hide internal directories.