Skip to content

Commit

Permalink
Document formAuthorizationUri and getAccessToken
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcsz committed Feb 12, 2017
1 parent 1688091 commit 05de9de
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# oauth2
OAuth 2.0 through Node
# OAuth2

OAuth 2.0 through Node.

## Functions

* `formAuthorzationUri`
* Returns a Promise that resolves to a complete authorization URL that you can redirect to.
* Accepts an object in the following format:

```javascript
{
client: {
id: 'SOME-CLIENT-ID',
secret: 'SOME-SECRET'
},
uri: {
authorization: 'https://someoauth.com/auth',
token: 'https://someoauth.com/token'
redirect: 'https://mywonderfulapp.com'
},
scope: 'SOME SCOPE HERE',
responseType: 'RESPONSE-TYPE-IF-ANY'
}
```

* `getAccessToken`
* Returns a Promise that resolves to an object containing the response from the token request.
* Accepts an object in the following format:

```javascript
{
client: {
id: 'SOME-CLIENT-ID',
secret: 'SOME-SECRET'
},
uri: {
authorization: 'https://someoauth.com/auth',
token: 'https://someoauth.com/token'
redirect: 'https://mywonderfulapp.com'
},
scope: 'SOME SCOPE HERE',
code: 'AUTHORIZATION-CODE'
}
```

0 comments on commit 05de9de

Please sign in to comment.