Documentation ¶
Overview ¶
Package client implements a low-level OAuth2 client to perform the various request/response flows against a OAuth2 authentication server.
Index ¶
- func BuildIntrospectionRequest(uri string, r introspection.Request) (*http.Request, error)
- func BuildRevocationRequest(uri string, r revocation.Request) (*http.Request, error)
- func BuildTokenRequest(uri string, r oauth2.TokenRequest) (*http.Request, error)
- func IntrospectionRequestValues(r introspection.Request) url.Values
- func ParseIntrospectionResponse(res *http.Response) (*introspection.Response, error)
- func ParseRequestError(res *http.Response) error
- func ParseTokenResponse(res *http.Response) (*oauth2.TokenResponse, error)
- func RevocationRequestValues(r revocation.Request) url.Values
- func TokenRequestValues(r oauth2.TokenRequest) url.Values
- type Client
- type Config
- type Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildIntrospectionRequest ¶
BuildIntrospectionRequest will build the provided request.
func BuildRevocationRequest ¶
BuildRevocationRequest will build the provided request.
func BuildTokenRequest ¶
BuildTokenRequest will build a request from the provided data.
func IntrospectionRequestValues ¶
func IntrospectionRequestValues(r introspection.Request) url.Values
IntrospectionRequestValues will return the form values for the provided request.
func ParseIntrospectionResponse ¶
func ParseIntrospectionResponse(res *http.Response) (*introspection.Response, error)
ParseIntrospectionResponse will parse the provided response.
func ParseRequestError ¶
ParseRequestError will try to parse an oauth2.Error from the provided response. It will fallback to an Error containing the servers response.
func ParseTokenResponse ¶
func ParseTokenResponse(res *http.Response) (*oauth2.TokenResponse, error)
ParseTokenResponse will parse the provided response.
func RevocationRequestValues ¶
func RevocationRequestValues(r revocation.Request) url.Values
RevocationRequestValues will return the form values for the provided request.
func TokenRequestValues ¶
func TokenRequestValues(r oauth2.TokenRequest) url.Values
TokenRequestValues will return the form values for the provided request.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a low-level OAuth2 client.
func (*Client) Authenticate ¶
func (c *Client) Authenticate(trq oauth2.TokenRequest) (*oauth2.TokenResponse, error)
Authenticate will send the provided token request and return the servers token response or an error if failed.
func (*Client) Introspect ¶
func (c *Client) Introspect(irq introspection.Request) (*introspection.Response, error)
Introspect will send the provided introspection request and return the servers response of an error if failed.