1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-08-06 22:13:02 +02:00

Changed auth URL and added tests

This commit is contained in:
Bob Briski
2018-02-27 22:50:02 -08:00
parent f9152870f4
commit 57050f9f92
3 changed files with 109 additions and 40 deletions

View File

@ -110,14 +110,16 @@ func main() {
A more thorough, [runnable example](examples/cookieauth/main.go) is provided in the examples directory.
Note: The `AuthURL` is almost always going to have the path `/rest/auth/1/session`
```go
tp := jira.CookieAuthTransport{
Username: "username",
Password: "password",
BaseURL: "https://my.jira.com",
AuthURL: "https://my.jira.com/rest/auth/1/session",
}
client, err := jira.NewClient(tp.Client(), tp.BaseURL)
client, err := jira.NewClient(tp.Client(), "https://my.jira.com")
u, _, err := client.User.Get("admin")
fmt.Printf("\nEmail: %v\nSuccess!\n", u.EmailAddress)