草庐IT

authentication_params

全部标签

javascript - 如何修复 Mongoose 模型的 deleteOne() 函数,当它不被 req.params.id 删除时?

首先要提到的是,我对Node.Js和MongoDB完全陌生。我正在使用Node.Js和MongoDB编写后端API,它将处理来自前端的GET、POST、DELETE请求,这些非常简单。我在使用DELETE功能时卡住了。这是我的posts.service.ts文件,其中包含此deletePost()函数,该函数将postId发送到后端app.js文件。`deletePost(postId:string){this.http.delete('http://localhost:3000/api/posts/'+postId).subscribe(()=>{console.log(postId

node.js - 蒙戈/ express : How to return all documents in collection if no query params are passed?

如果没有传递查询参数,我将尝试从我的Mongo集合中返回所有文档。目前我有3个可选的查询参数可以由用户传递。localhost:3000/api/projects//shouldreturnallprojects.Currentlythisisreturning[]localhost:3000/api/projects?id=1//shouldreturnprojectswithidof"1".Workingproperly.localhost:3000/api/projects?name=myproject//shouldreturnprojectswithnameof"myproj

javascript - express 和 Passport 错误 : Unknown authentication strategy "login"

我目前正在使用在线教程运行一个简单的测试MEAN堆栈:Node.jsExpress.jsPassport.js这是应用程序文件:app.jsvarexpress=require("express");varmongoose=require("mongoose");varpath=require("path");varbodyParser=require("body-parser");varcookieParser=require("cookie-parser");varsession=require("express-session");varflash=require("connec

java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘解决

最近遇到了 java.sql.SQLException:Unabletoloadauthenticationplugin'caching_sha2_password'.这个报错。主要原因8.x版本的验证模块和之前版本不同:5.x版本是:default_authentication_plugin=mysql_native_password8.x版本就是:default_authentication_plugin=caching_sha2_password 解决方案①更新mysql驱动的jar版本,修改为8.0.11版本mysqlmysql-connector-java8.0.11②修改数据库配置

mongodb - Meteor 项目部署和 mup 设置命令给出 "sshpass required for password based authentication"错误

我正在尝试部署一个基于Meteor的项目。我在服务器上使用nitrous.io,digitalocean,在MongoDB上使用compose.io。我已经想完成我的部署并运行“mup设置”命令并收到此消息:MeteorUp:ProductionQualityMeteorDeploymentssshpassrequiredforpasswordbasedauthentication尝试从此处http://git.io/_vHbvQ安装sshpass并运行命令“apt-getinstallsshpass”后,出现以下错误:E:Couldnotopenlockfile/var/lib/dp

关于post请求的三种参数【params,data,json】

基础不牢,地动山摇~处理海外某网站发帖接口时候,接口参数都逆完了,最后用aiohttp发送post请求,发现结果怎么都不对。最后一看post参数传入姿势不对。于是乎,仔细研究了一下。当使用aiohttp发送POST请求时,存在三种不同的参数:params、data和json。它们在如何发送数据以及发送什么类型的数据上有不同的用途。以下是它们的区别:params参数:params参数通常用于发送URL查询参数。这些参数会附加到请求的URL中,并以key=value的形式出现,用&符号分隔多个参数。就拼接在url问号?后面的东西。示例:importaiohttpasyncwithaiohttp.C

java - 无法使用带参数的构造函数 NO_CONSTRUCTOR 实例化 org.springframework.security.authentication.UsernamePasswordAuthenticationToken

我正在使用MongoDB编写自己的TokenStore(org.springframework.security.oauth2.provider.token.TokenStore)实现。为此,我使用了thecodeofIainPorter.我能够在mongo中保留token。我通过Autowiring我的自定义TokenStore的一个实例来做到这一点,然后我将它传递给端点。因此,我可以毫无问题地登录,但无法从资源服务器的mongo存储库中检索token。我的猜测是,将数据库中的对象转换/映射回Java对象时存在一些问题,该类是OAuth2AuthenticationReadConve

node.js - Node Passport 错误 : Unknown authentication strategy "local-login"

我一直在尝试在nodejs上使用Passport进行本地身份验证,据我所知,我的所有代码都是正确的,但我一直收到关于“未知身份验证策略”的同样烦人的错误,所以也许其他人可以帮助我对于这个问题,我的代码如下所示。这是我在nodejs中配置Passport的代码。varpassport=require('passport');varLocalStrategy=require('passport-local').Strategy;varUser=require('../models/user');module.exports=function(passport){passport.seria

MongoDB shell 历史不记得 'authentications'

当我在名为“authentications”的集合上使用命令时,MongoDB(MacOSXLion上的2.0.4)交互式shell的命令行历史记录不起作用,但它似乎适用于其他所有内容。$mongomydbMongoDBshellversion:2.0.4connectingto:mydb>db.aimsx.find().count()45>现在如果我点击向上箭头,我会得到这个:>db.aimsx.find().count()工作正常。但是,现在我对集合“身份验证”运行命令:>db.authentications.find().count()795>当我现在点击向上箭头时,我得到了这个

authentication - 如何验证以查看 mongodb 的 http 控制台?

我正在使用以下行运行一个mongodb进程:/usr/bin/mongod--dbpath/var/db/mongo--journal根据mongodb的文档:http://www.mongodb.org/display/DOCS/Http+Interface我应该能够使用http://myhost:28017访问http控制台当我尝试访问该页面时,它要求进行身份验证。根据文档,如果配置了安全性,我将需要进行身份验证。但是在查看mongodb.org/display/DOCS/Security+and+Authentication之后,我似乎很清楚我没有使用任何身份验证。我不使用--a