Skip to content
This repository has been archived by the owner on May 29, 2018. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
hiendv committed Nov 22, 2017
1 parent bd70743 commit c75c837
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if err != nil {
log.Fatal("oops")
}

// Login using OAuth?
// Login using OAuth
// Redirect users to the authentication code URL
url, err := auth.LoginURL("state")

Expand All @@ -49,9 +49,17 @@ if err != nil {

// Issue the JWT for the user
jwt, err := auth.IssueJWT(user)
if err != nil {
log.Fatal("oops")
}

// Authenticate with a given JWT
// Send the JWT to the user and let them use it to authenticate
// Authenticate a user using JWT
user, err = auth.Authenticate("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiaWQiLCJ1c2VybmFtZSI6InVzZXJuYW1lIiwicm9sZXMiOlsicm9sZSJdfSwiZXhwIjoxNjA1MDUyODAwLCJqdGkiOiJjbGFpbXMtaWQiLCJpYXQiOjE2MDUwNDkyMDB9.b0gxC2uZRek-SPwHSqyLOoW_DjSYroSivLqJG96Zxl0")
if err != nil {
log.Fatal("oops")
}

err = auth.Authorize(user, "action", "object")
```

Expand Down

0 comments on commit c75c837

Please sign in to comment.