Documentation ¶
Index ¶
- type Authenticator
- func (c *Authenticator) AuthorizeURL(state string, onlineAccess bool, scopes []string) string
- func (c *Authenticator) ChangeAuthURL(url string)
- func (c *Authenticator) ChangeTokenURL(url string)
- func (c *Authenticator) TokenExchange(code string) (*oauth2.Token, error)
- func (c *Authenticator) TokenSource(token *oauth2.Token) oauth2.TokenSource
- func (c *Authenticator) Verify(auth oauth2.TokenSource) (*MeResponse, error)
- type MeResponse
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
}
func NewAuthenticator ¶
func NewAuthenticator(client *http.Client, clientID string, clientSecret string, redirectURL string, scopes []string) *Authenticator
NewAuthenticator create a new EVE SSO Authenticator. Requires your application clientID, clientSecret, and redirectURL. RedirectURL must match exactly to what you registered with CCP.
func (*Authenticator) AuthorizeURL ¶
func (c *Authenticator) AuthorizeURL(state string, onlineAccess bool, scopes []string) string
AuthorizeURL returns a url for an end user to authenticate with EVE SSO and return success to the redirectURL. It is important to create a significatly unique state for this request and verify the state matches when returned to the redirectURL.
func (*Authenticator) ChangeAuthURL ¶
func (c *Authenticator) ChangeAuthURL(url string)
ChangeAuthURL changes the oauth2 configuration url for authentication
func (*Authenticator) ChangeTokenURL ¶
func (c *Authenticator) ChangeTokenURL(url string)
ChangeTokenURL changes the oauth2 configuration url for token
func (*Authenticator) TokenExchange ¶
func (c *Authenticator) TokenExchange(code string) (*oauth2.Token, error)
TokenExchange exchanges the code returned to the redirectURL with the CREST server to an access token. A caching client must be passed. This client MUST cache per CCP guidelines or face banning.
func (*Authenticator) TokenSource ¶
func (c *Authenticator) TokenSource(token *oauth2.Token) oauth2.TokenSource
TokenSource creates a refreshable token that can be passed to ESI functions
func (*Authenticator) Verify ¶
func (c *Authenticator) Verify(auth oauth2.TokenSource) (*MeResponse, error)
Verify the client and collect user information.