Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ConfigCtxKey = &contextKey{"Config"} ErrorCtxKey = &contextKey{"Error"} )
Functions ¶
Types ¶
type Authenticator ¶
type Config ¶
type Config struct { // ClientID is the application's ID. ClientID interface{} // Scope specifies optional requested permissions. Scopes []string }
type FileAuthenticator ¶
type FileAuthenticator struct { }
func NewFileAuthenticator ¶
func NewFileAuthenticator() *FileAuthenticator
func (*FileAuthenticator) Authenticate ¶
func (f *FileAuthenticator) Authenticate(username, password string, scope []string) (conf *Config, err error)
type JWTTokenGenerator ¶
type JWTTokenGenerator struct {
// contains filtered or unexported fields
}
func NewJWTTokenGenerator ¶
func NewJWTTokenGenerator(alg string, signKey interface{}, verifyKey interface{}, expireIn time.Duration) *JWTTokenGenerator
type Server ¶
type Server struct { Generator TokenGenerator Authenticator Authenticator }
func New ¶
func New(generator TokenGenerator, authenticator Authenticator) *Server
func (*Server) Authenticate ¶
func (s *Server) Authenticate(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.