-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document formAuthorizationUri and getAccessToken
- Loading branch information
Showing
1 changed file
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | ||
} | ||
``` |