Documentation ¶
Overview ¶
package refresh uses the refresh-token as a remember token (stored encrypted in a dedicated cookie).
Index ¶
- type Handler
- func (s Handler) ClearCookies(w http.ResponseWriter, r *http.Request)
- func (s Handler) HandleRefresh(w http.ResponseWriter, r *http.Request) (providerName string, cr goath.CallbackResult, err error)
- func (s Handler) HandleUnauthenticatedSession(w http.ResponseWriter, r *http.Request)
- func (s Handler) RootPath() string
- func (s Handler) SetRefreshCookie(w http.ResponseWriter, provider, refreshToken string)
- type Refresher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct { Providers map[string]Refresher BaseURL *url.URL CookiePrefix string CookieEncrypter goath.CookieEncrypter MaxAge int LoginChooserHandler http.Handler }
func (Handler) ClearCookies ¶
func (s Handler) ClearCookies(w http.ResponseWriter, r *http.Request)
func (Handler) HandleRefresh ¶
func (s Handler) HandleRefresh(w http.ResponseWriter, r *http.Request) (providerName string, cr goath.CallbackResult, err error)
HandleRefresh should be mounted on the RootPath URI. It will use the refresh token and return the result. SetRefreshCookie will be automatically called on success.
func (Handler) HandleUnauthenticatedSession ¶
func (s Handler) HandleUnauthenticatedSession(w http.ResponseWriter, r *http.Request)
HandleUnauthenticatedSession should be called when the session expired or is invalid. It will either redirect to the RootPath URI if the provider cookie is found or fallback to the LoginChooserHandler.
func (Handler) SetRefreshCookie ¶
func (s Handler) SetRefreshCookie(w http.ResponseWriter, provider, refreshToken string)
SetRefreshCookie should be called after initial authentication, to send the refresh-token as an encrypted cookie to the client.
Click to show internal directories.
Click to hide internal directories.