Skip to content

Commit d477b31

Browse files
committed
docs: Add InsufficientScopeError
1 parent 0a21723 commit d477b31

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

docs/api/errors/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Noteable error types:
2323
server-error
2424
invalid-argument-error
2525
access-denied-error
26+
insufficient-scope-error
2627
invalid-client-error
2728
invalid-grant-error
2829
invalid-request-error
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
========================
2+
InsufficientScopeError
3+
========================
4+
5+
The request requires higher privileges than provided by the access token. See :rfc:`Section 3.1 of RFC 6750 <6750#section-3.1>`.
6+
7+
::
8+
9+
const InsufficientScopeError = require('oauth2-server/lib/errors/insufficient-scope-error');
10+
11+
--------
12+
13+
.. _InsufficientScopeError#constructor:
14+
15+
``new InsufficientScopeError(message, properties)``
16+
===================================================
17+
18+
Instantiates an ``InsufficientScopeError``.
19+
20+
**Arguments:**
21+
22+
+----------------------------------------+--------------+-------------------------------------------------------------+
23+
| Name | Type | Description |
24+
+========================================+==============+=============================================================+
25+
| [message=undefined] | String|Error | See :ref:`OAuthError#constructor`. |
26+
+----------------------------------------+--------------+-------------------------------------------------------------+
27+
| [properties={}] | Object | See :ref:`OAuthError#constructor`. |
28+
+----------------------------------------+--------------+-------------------------------------------------------------+
29+
| [properties.code=403] | Object | See :ref:`OAuthError#constructor`. |
30+
+----------------------------------------+--------------+-------------------------------------------------------------+
31+
| [properties.name='insufficient_scope'] | String | The error name used in responses generated from this error. |
32+
+----------------------------------------+--------------+-------------------------------------------------------------+
33+
34+
**Return value:**
35+
36+
A new instance of ``InsufficientScopeError``.
37+
38+
**Remarks:**
39+
40+
::
41+
42+
const err = new InsufficientScopeError();
43+
// err.message === 'Forbidden'
44+
// err.code === 403
45+
// err.name === 'insufficient_scope'
46+
47+
--------
48+
49+
.. _InsufficientScopeError#message:
50+
51+
``message``
52+
===========
53+
54+
See :ref:`OAuthError#message <OAuthError#message>`.
55+
56+
--------
57+
58+
.. _InsufficientScopeError#code:
59+
60+
``code``
61+
========
62+
63+
Typically ``403``. See :ref:`OAuthError#code <OAuthError#code>`.
64+
65+
--------
66+
67+
.. _InsufficientScopeError#inner:
68+
69+
``inner``
70+
=========
71+
72+
See :ref:`OAuthError#inner <OAuthError#inner>`.
73+
74+
--------
75+
76+
.. _InsufficientScopeError#name:
77+
78+
``name``
79+
========
80+
81+
Typically ``'insufficient_scope'``. See :ref:`OAuthError#name <OAuthError#name>`.
82+

0 commit comments

Comments
 (0)