Skip to content

pomack/oauth2_client.go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}

About

Create a general oauth2 library for use with common services

Resources

Stars

Watchers

Forks

Packages

No packages published