{"record":{"id":"3cb5bd1206df3335","repo":"RocketChat/Rocket.Chat","slug":"access-denied","errorCode":"access_denied","errorMessage":"The user denied access to your application","messagePattern":"The user denied access to your application","errorType":"http","errorClass":null,"httpStatus":401,"severity":"error","filePath":"apps/meteor/server/oauth2-server/oauth.ts","lineNumber":138,"sourceCode":"\t\t\t}\n\n\t\t\tconst client = await OAuthApps.findOneActiveByClientId(req.query.client_id);\n\t\t\tif (client == null) {\n\t\t\t\treturn res.redirect('/oauth/error/404');\n\t\t\t}\n\n\t\t\tconst redirectUris: string[] = client.redirectUri.split(',');\n\n\t\t\tif (typeof req.query.redirect_uri === 'string' && !redirectUris.includes(req.query.redirect_uri)) {\n\t\t\t\treturn res.redirect('/oauth/error/invalid_redirect_uri');\n\t\t\t}\n\n\t\t\treturn next();\n\t\t});\n\n\t\tthis.app.post('/oauth/authorize', debugMiddleware, async (req, res, next) => {\n\t\t\tif (req.body.allow !== 'yes') {\n\t\t\t\tres.status(401);\n\t\t\t\treturn res.send({ error: 'access_denied', error_description: 'The user denied access to your application' });\n\t\t\t}\n\n\t\t\t// The new version of the library is expecting a new name. Doing this for compatibility\n\t\t\tif (req.body.token && !req.body.access_token) {\n\t\t\t\treq.body.access_token = req.body.token;\n\t\t\t}\n\n\t\t\tif (req.body.access_token == null) {\n\t\t\t\treturn res.status(401).send('No token');\n\t\t\t}\n\n\t\t\tconst user = await Users.findOne(\n\t\t\t\t{\n\t\t\t\t\t'services.resume.loginTokens.hashedToken': Accounts._hashLoginToken(req.body.access_token),\n\t\t\t\t},\n\t\t\t\t{ projection: { _id: 1 } },\n\t\t\t);","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/oauth2-server/oauth.ts#L120-L156","documentation":"Error \"The user denied access to your application\" thrown in RocketChat/Rocket.Chat.","triggerScenarios":"Thrown at apps/meteor/server/oauth2-server/oauth.ts:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The resource owner clicked 'deny' on the OAuth authorization page; ask them to approve the authorization request.","Review the requested scopes; the user may refuse because the application requests excessive permissions."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}