Documentation ¶
Index ¶
- Constants
- type AuthorizationEndpoint
- type Client
- type OAuth
- func (s *OAuth) AddClient(client *Client)
- func (s *OAuth) HandleAuthorization(w http.ResponseWriter, r *http.Request)
- func (s *OAuth) HasClient(client_id string) bool
- func (s *OAuth) HasSession(ses *Session) bool
- func (s *OAuth) LoadConfiguration() error
- func (s *OAuth) ResolveClient(client_id string) (*Client, error)
- func (s OAuth) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type RedirectEndpoint
- type Response
- type ResponseData
- type ResponseType
- type Session
- type Store
- type TemplateData
- type TokenEndpoint
Constants ¶
View Source
const ( AUTHORIZATION_CODE = "authorization_code" REFRESH_TOKEN = "refresh_token" PASSWORD = "password" CLIENT_CREDENTIALS = "client_credentials" ASSERTION = "assertion" IMPLICIT = "__implicit" LOGIN_PATH = "login" )
View Source
const AUTH_PATH = "/auth/"
View Source
const CLIENTBUCKET = "OAUTHCLIENTS"
View Source
const DBFILE = "oauthstore.db"
View Source
const DBFOLDER = "db"
View Source
const REDIRECT_PATH = "/redirect"
View Source
const REQUESTIDSIZE = 32
View Source
const SESSIONLIFETIME = 5
View Source
const TOKEN_PATH = "/token"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationEndpoint ¶
func (*AuthorizationEndpoint) Handle ¶
func (ae *AuthorizationEndpoint) Handle(w http.ResponseWriter, r *http.Request, s *Session, client *Client)
func (*AuthorizationEndpoint) SetLoginTemplate ¶
func (s *AuthorizationEndpoint) SetLoginTemplate(templateString string) error
func (*AuthorizationEndpoint) SetLoginTemplateFile ¶
func (s *AuthorizationEndpoint) SetLoginTemplateFile(templateFile string) error
type Client ¶
type OAuth ¶
type OAuth struct { AuthEndpoint *AuthorizationEndpoint TokenEndpoint *TokenEndpoint RedirectEndpoint *RedirectEndpoint Clients map[string]*Client http.Handler Initialized bool Store *Store // contains filtered or unexported fields }
func GetHandler ¶
func GetHandler() OAuth
func (*OAuth) HandleAuthorization ¶
func (s *OAuth) HandleAuthorization(w http.ResponseWriter, r *http.Request)
func (*OAuth) HasSession ¶
func (*OAuth) LoadConfiguration ¶
type RedirectEndpoint ¶
type RedirectEndpoint struct { }
func (*RedirectEndpoint) Handle ¶
func (t *RedirectEndpoint) Handle(w http.ResponseWriter, r *http.Request)
type Response ¶
type Response struct { Type ResponseType StatusCode int StatusText string ErrorStatusCode int URL string Headers http.Header IsError bool ErrorId string InternalError error RedirectInFragment bool Output ResponseData }
func NewResponse ¶
func NewResponse() *Response
func (*Response) SetErrorState ¶
type ResponseData ¶
type ResponseData map[string]interface{}
type Session ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) SetSession ¶
type TemplateData ¶
type TokenEndpoint ¶
type TokenEndpoint struct { }
func (*TokenEndpoint) Handle ¶
func (t *TokenEndpoint) Handle(w http.ResponseWriter, r *http.Request)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.