Documentation ¶
Overview ¶
Package obtainer provides an interface for OpenID Connect token obtainment from a provider
Index ¶
- func Register(name string, driver Driver)
- type Client
- type Conf
- type Driver
- type Obtainer
- func (o *Obtainer) ObtainToken(username, password, clientID string) (token interface{}, err error)
- func (o *Obtainer) RenewToken(token interface{}, clientID string) (newToken interface{}, err error)
- func (o *Obtainer) RevokeToken(token interface{}) error
- func (o *Obtainer) TokenString(token interface{}) (tokenString string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
func (*Client) Obtain ¶
Obtain obtains a new token and returns the token string. If token is already available, it just returns the token string
type Conf ¶ added in v1.1.0
type Conf struct { // Enabled is to toggle obtainer client Enabled bool `json:"enabled"` // Provider is the authentication provider name Provider string `json:"provider"` // ProviderURL is the authentication provider URL ProviderURL string `json:"providerURL"` // ClientID is the authentication client id. ClientID string `json:"clientID"` // Username is the client's username Username string `json:"username"` // Password is the client's password Password string `json:"password"` }
Conf is a reference configuration struct for Obtainer
type Driver ¶
type Driver interface { // ObtainToken requests a token in exchange for user credentials ObtainToken(serverAddr string, username, password, clientID string) (token interface{}, err error) // TokenString returns the string part of token object (e.g. access_token, id_token strings) TokenString(token interface{}) (tokenString string, err error) // RenewToken renews the token (when applicable) using information inside the token (e.g. refresh_token) RenewToken(serverAddr string, token interface{}, clientID string) (newToken interface{}, err error) // RevokeToken revokes a previously obtained token RevokeToken(serverAddr string, token interface{}) error }
Interface methods to login, obtain Service Ticket, and logout
type Obtainer ¶
type Obtainer struct {
// contains filtered or unexported fields
}
Obtainer struct
func (*Obtainer) ObtainToken ¶ added in v1.2.0
func (*Obtainer) RenewToken ¶ added in v1.2.0
func (*Obtainer) RevokeToken ¶ added in v1.2.0
func (*Obtainer) TokenString ¶ added in v1.2.0
Click to show internal directories.
Click to hide internal directories.