Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
// contains filtered or unexported fields
}
Authenticator is an auth requests handler.
func (*Authenticator) Callback ¶
func (u *Authenticator) Callback(w http.ResponseWriter, r *http.Request)
Callback is an external services callback handler.
func (*Authenticator) Index ¶
func (u *Authenticator) Index(w http.ResponseWriter, _ *http.Request)
Index is main page handler.
func (*Authenticator) LogInWith ¶
func (u *Authenticator) LogInWith(w http.ResponseWriter, r *http.Request)
LogInWith is an auth using external services handler.
type Config ¶
type Config struct { Bearer *bearer.Config BearerCookieName string Oauth map[string]*ServiceOauth TLSEnabled bool Host string RedirectURL string }
Config for authenticator handler.
type ServiceOauth ¶
type ServiceOauth struct {
// contains filtered or unexported fields
}
ServiceOauth is config for specific service.
func NewServiceConfig ¶
func NewServiceConfig(name string, oauth *oauth2.Config) (*ServiceOauth, error)
NewServiceConfig creates config for supported services.
func (*ServiceOauth) AuthCodeURL ¶
func (c *ServiceOauth) AuthCodeURL(state string) string
AuthCodeURL gets URL to auth on external service using state.
func (*ServiceOauth) GetUserEmail ¶
GetUserEmail receives user email after authentication on external service.
type Services ¶
type Services struct {
// contains filtered or unexported fields
}
Services stores supported external oauth2 services.
func NewServices ¶
func NewServices(configs map[string]*ServiceOauth) *Services
NewServices creates services storage using config.
Click to show internal directories.
Click to hide internal directories.