@@ -46,12 +46,16 @@ Uses the following values to check:</p>
46
46
<li >' ; saveRefreshToken' ; ,</li >
47
47
<li >' ; saveToken' ; ,</li >
48
48
<li >' ; getAccessToken' ; </li >
49
+ <li >' ; revokeToken' ; </li >
49
50
</ul >
50
51
</dd >
51
52
<dt ><a href =" #UserValidation " >UserValidation</a ></dt >
52
53
<dd ><p >Used to register handlers for different instances that validate users.
53
54
This allows you to validate user access on a client-based level.</p >
54
55
</dd >
56
+ <dt ><a href =" #validateParams " >validateParams</a > ⇒ <code >boolean</code ></dt >
57
+ <dd ><p >Abstraction that checks given query/body params against a given schema</p >
58
+ </dd >
55
59
<dt ><a href =" #app " >app</a > : <code >Object</code ></dt >
56
60
<dd ><p >Wrapped <code >WebApp</code > with express-style get/post and default use routes.</p >
57
61
</dd >
@@ -76,6 +80,8 @@ Implements the OAuth2Server model with Meteor-Mongo bindings.
76
80
* [ .saveRefreshToken(token, clientId, expires, user)] ( #OAuthMeteorModel+saveRefreshToken ) ⇒ <code >Promise.< ; \* > ; </code >
77
81
* [ .getRefreshToken()] ( #OAuthMeteorModel+getRefreshToken )
78
82
* [ .grantTypeAllowed(clientId, grantType)] ( #OAuthMeteorModel+grantTypeAllowed ) ⇒ <code >boolean</code >
83
+ * [ .verifyScope(accessToken, scope)] ( #OAuthMeteorModel+verifyScope ) ⇒ <code >Promise.< ; boolean> ; </code >
84
+ * [ .revokeToken()] ( #OAuthMeteorModel+revokeToken )
79
85
80
86
<a name =" OAuthMeteorModel+log " ></a >
81
87
@@ -199,6 +205,24 @@ getRefreshToken(token) should return an object with:
199
205
| clientId |
200
206
| grantType |
201
207
208
+ <a name =" OAuthMeteorModel+verifyScope " ></a >
209
+
210
+ ### oAuthMeteorModel.verifyScope(accessToken, scope) ⇒ <code >Promise.< ; boolean> ; </code >
211
+ Compares expected scope from token with actual scope from request
212
+
213
+ ** Kind** : instance method of [ <code >OAuthMeteorModel</code >] ( #OAuthMeteorModel )
214
+
215
+ | Param |
216
+ | --- |
217
+ | accessToken |
218
+ | scope |
219
+
220
+ <a name =" OAuthMeteorModel+revokeToken " ></a >
221
+
222
+ ### oAuthMeteorModel.revokeToken()
223
+ revokeToken(refreshToken) is required and should return true
224
+
225
+ ** Kind** : instance method of [ <code >OAuthMeteorModel</code >] ( #OAuthMeteorModel )
202
226
<a name =" OAuth2ServerDefaults " ></a >
203
227
204
228
## OAuth2ServerDefaults : <code >Object</code >
@@ -250,6 +274,7 @@ Defaults to a 500 response, unless further details were added.
250
274
| res | | |
251
275
| options | <code >Object</code > | options with error information |
252
276
| options.error | <code >String</code > | Error name |
277
+ | options.logError | <code >boolean</code > | optional flag to log the erroe to the console |
253
278
| options.description | <code >String</code > | Error description |
254
279
| options.uri | <code >String</code > | Optional uri to redirect to when error occurs |
255
280
| options.status | <code >Number</code > | Optional statuscode, defaults to 500 |
@@ -274,6 +299,7 @@ Uses the following values to check:
274
299
- 'saveRefreshToken',
275
300
- 'saveToken',
276
301
- 'getAccessToken'
302
+ - 'revokeToken'
277
303
278
304
** Kind** : global constant
279
305
** Returns** : <code >boolean</code > - true if valid, otherwise false
@@ -289,6 +315,24 @@ Used to register handlers for different instances that validate users.
289
315
This allows you to validate user access on a client-based level.
290
316
291
317
** Kind** : global constant
318
+
319
+ * [ UserValidation] ( #UserValidation )
320
+ * [ .register(instance, validationHandler)] ( #UserValidation.register )
321
+ * [ .isValid(instance, handlerArgs)] ( #UserValidation.isValid ) ⇒ <code >\* </code >
322
+
323
+ <a name =" UserValidation.register " ></a >
324
+
325
+ ### UserValidation.register(instance, validationHandler)
326
+ Registers a validation method that allows
327
+ to validate users on custom logic.
328
+
329
+ ** Kind** : static method of [ <code >UserValidation</code >] ( #UserValidation )
330
+
331
+ | Param | Type | Description |
332
+ | --- | --- | --- |
333
+ | instance | [ <code >OAuth2Server</code >] ( #OAuth2Server ) | |
334
+ | validationHandler | <code >function</code > | sync or async function that performs the validation |
335
+
292
336
<a name =" UserValidation.isValid " ></a >
293
337
294
338
### UserValidation.isValid(instance, handlerArgs) ⇒ <code >\* </code >
@@ -302,53 +346,23 @@ Delegates `handlerArgs` to the registered validation handler.
302
346
| instance | [ <code >OAuth2Server</code >] ( #OAuth2Server ) |
303
347
| handlerArgs | <code >\* </code > |
304
348
305
- <a name =" app " ></a >
349
+ <a name =" validateParams " ></a >
306
350
307
- ## app : <code >Object </code >
308
- Wrapped ` WebApp ` with express-style get/post and default use routes.
351
+ ## validateParams ⇒ <code >boolean </code >
352
+ Abstraction that checks given query/body params against a given schema
309
353
310
354
** Kind** : global constant
311
- ** See** : https://docs.meteor.com/packages/webapp.html
312
-
313
- * [ app] ( #app ) : <code >Object</code >
314
- * [ .get(url, handler)] ( #app.get )
315
- * [ .post(url, handler)] ( #app.post )
316
- * [ .use(args)] ( #app.use )
317
-
318
- <a name =" app.get " ></a >
319
-
320
- ### app.get(url, handler)
321
- Creates a get route for a given handler
322
-
323
- ** Kind** : static method of [ <code >app</code >] ( #app )
324
-
325
- | Param | Type |
326
- | --- | --- |
327
- | url | <code >string</code > |
328
- | handler | <code >function</code > |
329
-
330
- <a name =" app.post " ></a >
331
-
332
- ### app.post(url, handler)
333
- Creates a post route for a given handler.
334
- If headers' content-type does not equal to ` application/x-www-form-urlencoded `
335
- then it will be transformed accordingly.
336
-
337
- ** Kind** : static method of [ <code >app</code >] ( #app )
338
-
339
- | Param | Type |
340
- | --- | --- |
341
- | url | <code >string</code > |
342
- | handler | <code >function</code > |
343
-
344
- <a name =" app.use " ></a >
345
-
346
- ### app.use(args)
347
- Default wrapper around ` WebApp.use `
348
-
349
- ** Kind** : static method of [ <code >app</code >] ( #app )
350
355
351
356
| Param |
352
357
| --- |
353
- | args |
358
+ | actualParams |
359
+ | requiredParams |
360
+ | debug |
361
+
362
+ <a name =" app " ></a >
354
363
364
+ ## app : <code >Object</code >
365
+ Wrapped ` WebApp ` with express-style get/post and default use routes.
366
+
367
+ ** Kind** : global constant
368
+ ** See** : https://docs.meteor.com/packages/webapp.html
0 commit comments