InsufficientScopeError

The request requires higher privileges than provided by the access token. See Section 3.1 of RFC 6750.

const InsufficientScopeError = require('@node-oauth/oauth2-server/lib/errors/insufficient-scope-error');

new InsufficientScopeError(message, properties)

Instantiates an InsufficientScopeError.

Arguments:

Name

Type

Description

[message=undefined]

String|Error

See new OAuthError(message, properties).

[properties={}]

Object

See new OAuthError(message, properties).

[properties.code=403]

Object

See new OAuthError(message, properties).

[properties.name=’insufficient_scope’]

String

The error name used in responses generated from this error.

Return value:

A new instance of InsufficientScopeError.

Remarks:

const err = new InsufficientScopeError();
// err.message === 'Forbidden'
// err.code === 403
// err.name === 'insufficient_scope'

message

See OAuthError#message.


code

Typically 403. See OAuthError#code.


inner

See OAuthError#inner.


name

Typically 'insufficient_scope'. See OAuthError#name.