diff --git a/lib/handlers/authorize-handler.js b/lib/handlers/authorize-handler.js index 984136a8d..ebb4bc903 100644 --- a/lib/handlers/authorize-handler.js +++ b/lib/handlers/authorize-handler.js @@ -221,7 +221,7 @@ AuthorizeHandler.prototype.getState = function(request) { throw new InvalidRequestError('Missing parameter: `state`'); } - if (!is.vschar(state)) { + if (!is.vschar(state) && ((!state || !state.length) && !this.allowEmptyState) || state.length) { throw new InvalidRequestError('Invalid parameter: `state`'); }