Documentation
¶
Index ¶
- Variables
- type BasicUserInfo
- type GithubTeam
- type OAuthInfo
- type Service
- type SocialAuth0
- type SocialBase
- type SocialConnector
- type SocialGenericOAuth
- type SocialGithub
- type SocialGoogle
- type SocialLine
- type SocialService
- func (ss *SocialService) GetConnector(name string) (SocialConnector, error)
- func (ss *SocialService) GetOAuthHttpClient(name string) (*http.Client, error)
- func (ss *SocialService) GetOAuthInfoProvider(name string) *OAuthInfo
- func (ss *SocialService) GetOAuthInfoProviders() map[string]*OAuthInfo
- func (ss *SocialService) GetOAuthProviders() map[string]bool
- type UserInfoJson
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SocialBaseUrl = utils.Getenv("OAUTH_LOGIN_URL", "/login/") SocialMap = make(map[string]SocialConnector) )
Functions ¶
This section is empty.
Types ¶
type BasicUserInfo ¶
type GithubTeam ¶
type OAuthInfo ¶
type OAuthInfo struct {
ClientId, ClientSecret string
Scopes []string
AuthUrl, TokenUrl string
Enabled bool
EmailAttributeName string
EmailAttributePath string
AllowedDomains []string
HostedDomain string
ApiUrl string
AllowSignup bool
Name string
TlsClientCert string
TlsClientKey string
TlsClientCa string
TlsSkipVerify bool
UsePKCE bool
}
type SocialAuth0 ¶
type SocialAuth0 struct { *SocialBase // contains filtered or unexported fields }
func (*SocialAuth0) Type ¶
func (s *SocialAuth0) Type() int
func (*SocialAuth0) UserInfo ¶
func (s *SocialAuth0) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error)
type SocialBase ¶
func (*SocialBase) IsEmailAllowed ¶
func (s *SocialBase) IsEmailAllowed(email string) bool
func (*SocialBase) IsSignUpAllowed ¶
func (s *SocialBase) IsSignUpAllowed() bool
type SocialConnector ¶
type SocialConnector interface { Type() int UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error) IsEmailAllowed(email string) bool IsSignUpAllowed() bool AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string Exchange(ctx context.Context, code string, authOptions ...oauth2.AuthCodeOption) (*oauth2.Token, error) Client(ctx context.Context, t *oauth2.Token) *http.Client TokenSource(ctx context.Context, t *oauth2.Token) oauth2.TokenSource }
type SocialGenericOAuth ¶
type SocialGenericOAuth struct { *SocialBase // contains filtered or unexported fields }
func (*SocialGenericOAuth) Type ¶
func (s *SocialGenericOAuth) Type() int
func (*SocialGenericOAuth) UserInfo ¶
func (s *SocialGenericOAuth) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error)
type SocialGithub ¶
type SocialGithub struct { *SocialBase // contains filtered or unexported fields }
type SocialGoogle ¶
type SocialGoogle struct { *SocialBase // contains filtered or unexported fields }
func (*SocialGoogle) Type ¶
func (s *SocialGoogle) Type() int
func (*SocialGoogle) UserInfo ¶
func (s *SocialGoogle) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error)
type SocialLine ¶
type SocialLine struct { *SocialBase // contains filtered or unexported fields }
func (*SocialLine) Type ¶
func (s *SocialLine) Type() int
func (*SocialLine) UserInfo ¶
func (s *SocialLine) UserInfo(client *http.Client, token *oauth2.Token) (*BasicUserInfo, error)
type SocialService ¶
type SocialService struct {
// contains filtered or unexported fields
}
func ProvideService ¶
func ProvideService(cfg *config.Config) *SocialService
func (*SocialService) GetConnector ¶
func (ss *SocialService) GetConnector(name string) (SocialConnector, error)
func (*SocialService) GetOAuthHttpClient ¶
func (ss *SocialService) GetOAuthHttpClient(name string) (*http.Client, error)
func (*SocialService) GetOAuthInfoProvider ¶
func (ss *SocialService) GetOAuthInfoProvider(name string) *OAuthInfo
func (*SocialService) GetOAuthInfoProviders ¶
func (ss *SocialService) GetOAuthInfoProviders() map[string]*OAuthInfo
func (*SocialService) GetOAuthProviders ¶
func (ss *SocialService) GetOAuthProviders() map[string]bool
type UserInfoJson ¶
type UserInfoJson struct { Name string `json:"name"` DisplayName string `json:"display_name"` Login string `json:"login"` Username string `json:"username"` Email string `json:"email"` Upn string `json:"upn"` Attributes map[string][]string `json:"attributes"` // contains filtered or unexported fields }
func (*UserInfoJson) String ¶
func (info *UserInfoJson) String() string
Click to show internal directories.
Click to hide internal directories.