Documentation ¶
Overview ¶
Package ussologin defines functionality used for allowing clients to authenticate with the Candid server using USSO OAuth.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInteractor ¶
func NewInteractor(tg TokenGetter) httpbakery.Interactor
NewInteractor creates a new httpbakery.Interactor that interacts using the usso_oauth protocol.
func SetInteraction ¶
func SetInteraction(ierr *httpbakery.Error, url string)
SetInteraction sets the required values for the usso_oauth interaction method on an interaction required error.
Types ¶
type FileTokenStore ¶
type FileTokenStore struct {
// contains filtered or unexported fields
}
FileTokenStore implements the TokenStore interface by storing the JSON-encoded oauth token in a file.
func NewFileTokenStore ¶
func NewFileTokenStore(path string) *FileTokenStore
NewFileTokenStore returns a new FileTokenStore that uses the given path for storage.
type FormTokenGetter ¶
A FormTokenGetter is a TokenGetter implementation that presents a form to the user to get login details, and then uses those to get a token from Ubuntu SSO.
func (FormTokenGetter) GetToken ¶
GetToken uses filler to interact with the user and uses the provided information to obtain an OAuth token from Ubuntu SSO. The returned token can subsequently be used with LoginWithToken to perform a login. The tokenName argument is used as the name of the generated token in Ubuntu SSO. If Ubuntu SSO returned an error when trying to retrieve the token the error will have a cause of type *usso.Error.
type LoginResponse ¶
type LoginResponse struct {
DischargeToken *httpbakery.DischargeToken `json:"discharge-token"`
}
A LoginResponse is a response from the login endpoint following a successful interaction.
type StoreTokenGetter ¶
type StoreTokenGetter struct { Store TokenStore TokenGetter TokenGetter }
A StoreTokenGetter is a TokenGetter that will try to retrieve the token from some storage, before falling back to another TokenGetter. If the fallback TokenGetter sucessfully retrieves a token then that token will be put in the store.
type TokenGetter ¶
A TokenGetter is used to fetch a Ubuntu SSO OAuth token.