 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
Constants ¶
      View Source
      
  
    const ( AUTHORIZATION_CODE AccessRequestType = "authorization_code" REFRESH_TOKEN = "refresh_token" PASSWORD = "password" CLIENT_CREDENTIALS = "client_credentials" IMPLICIT = "__implicit" )
      View Source
      
  
const ( E_INVALID_REQUEST string = "invalid_request" E_UNAUTHORIZED_CLIENT = "unauthorized_client" E_ACCESS_DENIED = "access_denied" E_UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type" E_INVALID_SCOPE = "invalid_scope" E_SERVER_ERROR = "server_error" E_TEMPORARILY_UNAVAILABLE = "temporarily_unavailable" E_UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type" E_INVALID_GRANT = "invalid_grant" E_INVALID_CLIENT = "invalid_client" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessData ¶
type AccessData struct {
	TokenType    string
	AccessToken  string
	RefreshToken string
	Expiration   *int32
	ResponseData ResponseData
}
    Access data
type AccessRequest ¶
type AccessRequest struct {
	Type             AccessRequestType
	AuthorizeData    *AuthorizeData
	CustomParameters map[string]string
	// contains filtered or unexported fields
}
    Access request information
func (*AccessRequest) GetToken ¶
func (c *AccessRequest) GetToken() (*AccessData, error)
Send a token request and capture data. On OAuth2 error, and osincli.Error is returned as error
func (*AccessRequest) GetTokenUrl ¶
func (c *AccessRequest) GetTokenUrl() *url.URL
Generate a token url. This may not be the exact url that is used, as it may be submited with basic authentication or form-encoded.
type AccessRequestType ¶
type AccessRequestType string
type AuthorizeRequest ¶
type AuthorizeRequest struct {
	Type             AuthorizeRequestType
	CustomParameters map[string]string
	// contains filtered or unexported fields
}
    Authorize request information
func (*AuthorizeRequest) GetAuthorizeUrl ¶
func (c *AuthorizeRequest) GetAuthorizeUrl() *url.URL
Returns the authorize url
func (*AuthorizeRequest) GetAuthorizeUrlWithParams ¶
func (c *AuthorizeRequest) GetAuthorizeUrlWithParams(state string) *url.URL
Returns the authorize url
func (*AuthorizeRequest) HandleRequest ¶
func (c *AuthorizeRequest) HandleRequest(r *http.Request) (*AuthorizeData, error)
Handle the authorization request
type AuthorizeRequestType ¶
type AuthorizeRequestType string
const (
	CODE AuthorizeRequestType = "code"
)
    type Client ¶
type Client struct {
	// Transport is the HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
	// contains filtered or unexported fields
}
    func (*Client) NewAccessRequest ¶
func (c *Client) NewAccessRequest(t AccessRequestType, ad *AuthorizeData) *AccessRequest
func (*Client) NewAuthorizeRequest ¶
func (c *Client) NewAuthorizeRequest(t AuthorizeRequestType) *AuthorizeRequest
Creates a new authorize request
func (*Client) NewCustomRequest ¶
func (c *Client) NewCustomRequest() *CustomRequest
type ClientConfig ¶
type CustomRequest ¶
type CustomRequest struct {
	CustomParameters map[string]string
	// contains filtered or unexported fields
}
    Custom request information
func (*CustomRequest) GetRequest ¶
func (c *CustomRequest) GetRequest(url *url.URL) (*CustomData, error)
Send a custom request On OAuth2 error, and osincli.Error is returned as error
       Source Files
      ¶
      Source Files
      ¶
    
  
       Directories
      ¶
      Directories
      ¶
    
    | Path | Synopsis | 
|---|---|
| example
       | |
| 
          
            google
            
            command
          
          
         | |
| 
          
            osin
            
            command
          
           To test with the osin samples, change the RedirectUri to "http://localhost:14001/appauth" in osin/examples/teststorage.to | To test with the osin samples, change the RedirectUri to "http://localhost:14001/appauth" in osin/examples/teststorage.to | 
 Click to show internal directories. 
   Click to hide internal directories.