github.com/pomack/oauth2_client.go/oauth2_client/cmd

Create a general oauth2 library for use with common services


Install
go get github.com/pomack/oauth2_client.go/oauth2_client/cmd

Documentation

Purpose:
   General use library for making requests using OAuth1.0 and OAuth2 for various services.

Dependencies:
   http://github.com/pomack/jsonhelper.go/

Services supported:
   * Facebook
   * Google
   * Google+
   * LinkedIn
   * SmugMug
   * Twitter
   * Yahoo!

Examples:
   example/example.go for a basic example
   oauth2_client/cmd/oauth2_client_tester.go for a more detailed example.
   All the properties that are used can be found in oauth2_client/cmd/settings.json.

Base interface available for all OAuth clients:

type OAuth2Client interface {
    ServiceId() string
    Client() *http.Client
    Initialize(properties jsonhelper.JSONObject)
    GenerateRequestTokenUrl(properties jsonhelper.JSONObject) string
    RequestTokenGranted(req *http.Request) bool
    ExchangeRequestTokenForAccess(req *http.Request) os.Error
    CreateAuthorizedRequest(method string, headers http.Header, uri string, query url.Values, r io.Reader) (*http.Request, os.Error)
    RetrieveUserInfo() (UserInfo, os.Error)
}