Skip to content

Commit

Permalink
Updating the debug documentation to show how it is used with OAuth 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Forestmb committed Nov 25, 2017
1 parent 4fbe812 commit 15039dd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ To make sure this build runs before every commit, use:
## Debug ##

The `goff/debug` package can be used to help with developing `goff`. It uses
the OAuth 1.0 consumer provided by `goff` to make arbitrary `GET` request to
the Yahoo Fantasy Sports APIs and outputs the string XML response. To run:
the OAuth 2.0 configuraiton provided by `goff` to make arbitrary `GET` request
to the Yahoo Fantasy Sports APIs and outputs the string XML response. To run:

$ cd $GOPATH/src/github.com/Forestmb/goff
$ go run debug/debug.go --clientKey=<key> --clientSecret=<secret>
$ go run debug/debug.go --clientKey=<key> --clientSecret=<secret> --redirectURL=<redirect-url>

The values `key` and `secret` can be obtained after registering your own
applicaiton: http://developer.yahoo.com/fantasysports/guide/GettingStarted.html

The `redirect-url` must match the callback domain given when registering the
application with Yahoo. For development, using `127.0.0.1` for the domain and
`http://127.0.0.1` as the redirect URL should suffice.
6 changes: 3 additions & 3 deletions fantasy.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// 1. Obtain an API key for your application.
// See https://developer.apps.yahoo.com/dashboard/createKey.html
// 2. Call goff.GetOAuth2Config(clientId, clientSecret, redirectURL) using
// your client's information.
// 3. Use oath2.Config to obtain an oauth2.Token.
// See https://godoc.org/golang.org/x/oauth2#example-Config
// your client's information.
// 3. Use oath2.Config to obtain an oauth2.Token.
// See https://godoc.org/golang.org/x/oauth2#example-Config
// 4. Call oauth2Config.Client(ctx, token) with the config and access token.
// 5. Pass the returned http.Client into goff.NewClient.
// 6. Use the returned goff.Client to make direct API requests with
Expand Down

0 comments on commit 15039dd

Please sign in to comment.