modulepackage
0.0.0-20190623134757-126b35219450
Repository: https://github.com/mrjones/oauth.git
Documentation: pkg.go.dev
# README
OAuth 1.0 Library for Go
(If you need an OAuth 2.0 library, check out: https://godoc.org/golang.org/x/oauth2)
Developing your own apps, with this library
-
First, install the library
go get github.com/mrjones/oauth
-
Then, check out the comments in oauth.go
-
Or, have a look at the examples:
-
Netflix
go run examples/netflix/netflix.go --consumerkey [key] --consumersecret [secret] --appname [appname]
-
Twitter
Command line:
go run examples/twitter/twitter.go --consumerkey [key] --consumersecret [secret]
Or, in the browser (using an HTTP server):
go run examples/twitterserver/twitterserver.go --consumerkey [key] --consumersecret [secret] --port 8888
-
The Google Latitude example is broken, now that Google uses OAuth 2.0
-
Contributing to this library
-
Please install the pre-commit hook, which will run tests, and go-fmt before committing.
ln -s $PWD/pre-commit.sh .git/hooks/pre-commit
-
Running tests and building is as you'd expect:
go test *.go go build *.go
# Packages
No description provided by the author
# Functions
Creates a new Consumer instance, with a HMAC-SHA1 signer - consumerKey and consumerSecret: values you should obtain from the ServiceProvider when you register your application.
Creates a new Consumer instance, with a HMAC signer - consumerKey and consumerSecret: values you should obtain from the ServiceProvider when you register your application.
Creates a new Consumer instance, with a HMAC-SHA1 signer - consumerKey and consumerSecret: values you should obtain from the ServiceProvider when you register your application.
Creates a new Consumer instance, with a RSA signer - consumerKey: value you should obtain from the ServiceProvider when you register your application.
No description provided by the author
NewProvider takes a function to get the consumer secret from a datastore.
Creates a new Consumer instance, with a RSA-SHA1 signer - consumerKey: value you should obtain from the ServiceProvider when you register your application.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
No description provided by the author
Consumers are stateless, you can call the various methods (GetRequestTokenAndUrl, AuthorizeToken, and Get) on various different instances of Consumers *as long as they were set up in the same way.* It is up to you, as the caller to persist the necessary state (RequestTokens and AccessTokens).
No description provided by the author
HTTPExecuteError signals that a call to httpExecute failed.
No description provided by the author
Provider provides methods for a 2-legged Oauth1 provider.
TODO(mrjones) Do we definitely want separate "Request" and "Access" token classes? They're identical structurally, but used for different purposes.
No description provided by the author
No description provided by the author
Information about how to contact the service provider (see #1 above).
# Interfaces
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author