 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Variables
- func InternalErrorHandler(err error) (re *errors.Response)
- func NewClientStore(fn func(ctx echo.Context, appID string) (oauth2.ClientInfo, error)) oauth2.ClientStore
- func PasswordAuthorizationHandler(ctx context.Context, clientID, username, password string) (userID string, err error)
- func RefreshingScopeHandler(tgr *oauth2.TokenGenerateRequest, oldScope string) (allowed bool, err error)
- func RefreshingValidationHandler(ti oauth2.TokenInfo) (allowed bool, err error)
- func ResponseErrorHandler(re *errors.Response)
- func Route(g echo.RouteRegister, loginHandler func(echo.Context) error, ...)
- func UserAuthorizeHandler(w http.ResponseWriter, r *http.Request) (userID string, err error)
- type AgreedScopeStorer
- type AppClient
- type AuthCodeRequestData
- type TokenRequestData
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var ( DefaultAppClient oauth2.ClientStore = NewClientStore(nil) Default = oauth2s.NewConfig() )
      View Source
      
  
    var ( // Debug 调试模式 Debug bool )
      View Source
      
  
var ( // RoutePrefix 路由前缀 RoutePrefix string )
Functions ¶
func InternalErrorHandler ¶
func NewClientStore ¶
func PasswordAuthorizationHandler ¶
func PasswordAuthorizationHandler(ctx context.Context, clientID, username, password string) (userID string, err error)
PasswordAuthorizationHandler 密码认证处理
func RefreshingScopeHandler ¶
func RefreshingScopeHandler(tgr *oauth2.TokenGenerateRequest, oldScope string) (allowed bool, err error)
RefreshingScopeHandler check the scope of the refreshing token
func RefreshingValidationHandler ¶
RefreshingValidationHandler check if refresh_token is still valid. eg no revocation or other
func ResponseErrorHandler ¶
func UserAuthorizeHandler ¶
UserAuthorizeHandler 查询用户授权信息
Types ¶
type AgreedScopeStorer ¶
type AppClient ¶
type AuthCodeRequestData ¶
type AuthCodeRequestData struct {
	ClientID     string   `json:"client_id" xml:"client_id"`
	RedirectURI  string   `json:"redirect_uri" xml:"redirect_uri"`
	ResponseType string   `json:"response_type" xml:"response_type"` // code|token
	Scope        []string `json:"scope" xml:"scope"`
	State        string   `json:"state" xml:"state"`
}
    func (*AuthCodeRequestData) FromContext ¶
func (a *AuthCodeRequestData) FromContext(ctx echo.Context) *AuthCodeRequestData
type TokenRequestData ¶
type TokenRequestData struct {
	Code        string `json:"code" xml:"code"`
	GrantType   string `json:"grant_type" xml:"grant_type"`
	RedirectURI string `json:"redirect_uri" xml:"redirect_uri"`
}
    func (*TokenRequestData) FromContext ¶
func (a *TokenRequestData) FromContext(ctx echo.Context) *TokenRequestData
       Source Files
      ¶
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.