You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: API.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# API
2
2
3
-
Node.js client library for [OAuth2](http://oauth.net/2/). OAuth2 allows users to grant access to restricted resources by thirdparty applications, giving them the possibility to enable and disable those accesses whenever they want.
3
+
Node.js client library for [OAuth2](http://oauth.net/2/). OAuth2 allows users to grant access to restricted resources by third-party applications, giving them the possibility to enable and disable those accesses whenever they want.
4
4
5
5
## Options
6
6
@@ -14,18 +14,18 @@ Simple OAuth2 grant classes accept an object with the following params.
14
14
15
15
*`auth` - required object with the following properties:
16
16
*`tokenHost` - Base URL used to obtain access tokens. Required
17
-
*`tokenPath` - URL path to obtain access tokens (See [url resolution notes](#url-resolution)). Defaults to **/oauth/token**
18
-
*`refreshPath` - URL path to refresh access tokens (See [url resolution notes](#url-resolution)). Defaults to `auth.tokenPath`
19
-
*`revokePath` - URL path to revoke access tokens (See [url resolution notes](#url-resolution)). Defaults to **/oauth/revoke**
17
+
*`tokenPath` - URL path to obtain access tokens (See [URL resolution notes](#url-resolution)). Defaults to **/oauth/token**
18
+
*`refreshPath` - URL path to refresh access tokens (See [URL resolution notes](#url-resolution)). Defaults to `auth.tokenPath`
19
+
*`revokePath` - URL path to revoke access tokens (See [URL resolution notes](#url-resolution)). Defaults to **/oauth/revoke**
20
20
*`authorizeHost` - Base URL used to request an *authorization code*. Only valid for *AuthorizationCode*. Defaults to `auth.tokenHost` value
21
-
*`authorizePath` - URL path to request an *authorization code* (See [url resolution notes](#url-resolution)). Only valid for *AuthorizationCode*. Defaults to **/oauth/authorize**
21
+
*`authorizePath` - URL path to request an *authorization code* (See [URL resolution notes](#url-resolution)). Only valid for *AuthorizationCode*. Defaults to **/oauth/authorize**
22
22
23
23
*`http` optional object used to set default options to the internal http library ([wreck](https://github.com/hapijs/wreck)). All options except **baseUrl** are allowed
24
24
*`json`: JSON response parsing mode. Defaults to **strict**
25
25
*`redirects` Number or redirects to follow. Defaults to **false** (no redirects)
26
26
*`headers` Http headers
27
-
*`accept` Acceptable http response contenttype. Defaults to **application/json**
28
-
*`authorization` Always overriden by the library to properly send the required credentials on each scenario
27
+
*`accept` Acceptable http response content-type. Defaults to **application/json**
28
+
*`authorization` Always overridden by the library to properly send the required credentials on each scenario
29
29
30
30
*`options` additional options to setup how the module perform requests
31
31
*`scopeSeparator` Scope separator character. Some providers may require a different separator. Defaults to **empty space**
@@ -45,7 +45,7 @@ Creates the authorization URL from the *client configuration* and the *authorize
45
45
46
46
*`redirectURI` String representing the registered application URI where the user is redirected after authentication
47
47
*`scope` String or array of strings representing the application privileges
48
-
*`state` String representing an opaque value used by the client to main the state between the request and the callback
48
+
*`state` String representing an opaque value used by the client to maintain the state between the request and the callback
49
49
50
50
Additional options will be automatically serialized as query params in the resulting URL.
51
51
@@ -59,7 +59,7 @@ Get a new access token using the current grant type.
59
59
60
60
Additional options will be automatically serialized as params for the token request.
61
61
62
-
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overriden as documented by the module `http` options.
62
+
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overridden as documented by the module `http` options.
63
63
64
64
#### .createToken(token) => AccessToken
65
65
Creates a new access token by providing a token object as specified by [RFC6750](https://tools.ietf.org/html/rfc6750#section-4).
@@ -77,7 +77,7 @@ Get a new access token using the current grant type.
77
77
78
78
Additional options will be automatically serialized as params for the token request.
79
79
80
-
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overriden as documented by the module `http` options.
80
+
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overridden as documented by the module `http` options.
81
81
82
82
#### .createToken(token) => AccessToken
83
83
Creates a new access token by providing a token object as specified by [RFC6750](https://tools.ietf.org/html/rfc6750#section-4).
@@ -93,7 +93,7 @@ Get a new access token using the current grant type.
93
93
94
94
Additional options will be automatically serialized as params for the token request.
95
95
96
-
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overriden as documented by the module `http` options.
96
+
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overridden as documented by the module `http` options.
97
97
98
98
#### .createToken(token) => AccessToken
99
99
Creates a new access token by providing a token object as specified by [RFC6750](https://tools.ietf.org/html/rfc6750#section-4).
@@ -109,21 +109,21 @@ Refreshes the current access token. The following params are allowed:
109
109
110
110
*`params`
111
111
*`[scope]` Optional string or array including a subset of the original token scopes to request
112
-
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overriden as documented by the module `http` options.
112
+
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overridden as documented by the module `http` options.
113
113
114
114
Additional options will be automatically serialized as query params for the token request.
115
115
116
116
#### await .revoke(tokenType, [httpOptions])
117
117
Revokes either the access or refresh token depending on the {tokenType} value. Token type can be one of: `access_token` or `refresh_token`.
118
118
119
-
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overriden as documented by the module `http` options.
119
+
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overridden as documented by the module `http` options.
120
120
121
121
#### await .revokeAll([httpOptions])
122
122
Revokes both the current access and refresh tokens
123
123
124
-
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overriden as documented by the module `http` options.
124
+
*`httpOptions` All [wreck](https://github.com/hapijs/wreck) options can be overridden as documented by the module `http` options.
125
125
126
126
#### .token
127
127
Immutable object containing the token object provided while constructing a new access token instance. This property will usually have the schema as specified by [RFC6750](https://tools.ietf.org/html/rfc6750#section-4), but the exact properties may vary between authorization servers.
128
128
129
-
Please also note, that the current implementation will always add an **expires_at** property regardless of the authorization server response, as we require it to to provide the refresh token functionality.
129
+
Please also note that the current implementation will always add an **expires_at** property regardless of the authorization server response, as we require it to provide the refresh token functionality.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Contributing
2
2
3
-
Fork the repo on github and send a pull requests with feature branches to the ```develop``` branch. Do not forget to provide tests to your contribution.
3
+
Fork the repo on GitHub and send a pull requests with feature branches to the ```develop``` branch. Do not forget to provide tests to your contribution.
4
4
5
5
## Node version
6
6
This project is pinned to an specific node version for local development by using [volta](https://volta.sh/) as engines manager. Make sure you have it installed, to ensure your changes are tested with our recommended engine.
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,11 +158,11 @@ See the [API reference](./API.md#new-clientcredentialsoptions) for a complete re
158
158
159
159
### Access Token
160
160
161
-
On completion of any [supported grant type](#supported-grant-types) an access token will be obtained. A list of supported operations can be found below.
161
+
On completion of any [supported grant type](#supported-grant-types), an access token will be obtained. A list of supported operations can be found below.
162
162
163
163
#### Refresh an access token
164
164
165
-
On longlived applications, it is often necessary to refresh access tokens. In such scenarios the access token is usually persisted in an external database by first serializing it.
165
+
On long-lived applications, it is often necessary to refresh access tokens. In such scenarios, the access token is usually persisted in an external database by first serializing it.
166
166
167
167
168
168
```javascript
@@ -321,7 +321,7 @@ Simple OAuth 2.0 is licensed under the [Apache License, Version 2.0](http://www.
321
321
322
322
## Thanks to Open Source
323
323
324
-
Simple OAuth 2.0 come to life thanks to the work I've made in Lelylan, an open source microservices architecture for the Internet of Things. If this project helped you in any way, think about giving us a <ahref="https://github.com/lelylan/lelylan">star on Github</a>.
324
+
Simple OAuth 2.0 come to life thanks to the work I've made in Lelylan, an open source microservices architecture for the Internet of Things. If this project helped you in any way, think about giving us a <ahref="https://github.com/lelylan/lelylan">star on GitHub</a>.
0 commit comments