- 浏览: 2486711 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
MongoDB 2019(3)Security and Auth
Started the mongo cluster first
Connect to it
> mongo -host rancher-worker2 -port 27017
> rs.slaveOk();
> db.users.find();
Check DB
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
test 0.000GB
Switch to use admin
> use admin
switched to db admin
check if there is any users in DB
> db.system.users.find();
sillycat:PRIMARY>
No users, so I add one user there
https://docs.mongodb.com/manual/tutorial/create-users/
> use admin
switched to db admin
> db.createUser({user: "carl",pwd: "password",roles:[{role: "userAdminAnyDatabase", db:"admin"}]})
Successfully added user: {
"user" : "carl",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
}
]
}
Verify my auth
> db.auth("carl","password")
1
Exit and change the configuration for mongodb
> vi conf/mongodb.conf
auth = true
Kill the mongo process and start them again one by one
> mongod -f conf/mongodb.conf
In theory, it should be good to go now.
Wrong password will fail
> mongo --host rancher-home --port 27017 -ucarl -padfasdf --authenticationDatabase admin
Good password will be good
> mongo --host rancher-home --port 27017 -ucarl -ppassword --authenticationDatabase admin
> rs.slaveOk();
sillycat:OTHER>
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
test 0.000GB
> use admin
Check Users
> db.system.users.find()
{ "_id" : "admin.carl", "userId" : UUID("73415070-d63d-4377-ac3f-a247521a9d43"), "user" : "carl", "db" : "admin", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "pYlkO1HuxIyKAM9fmnWZvQ==", "storedKey" : "cDocJ/FMaE3+T/KA02kQ+z2tjas=", "serverKey" : "BZe3saf4s7eqzc+Ks6kmvuJRTLw=" }, "SCRAM-SHA-256" : { "iterationCount" : 15000, "salt" : "CfET/OxJEo2eRnJufeaVKSmEy+7U89m7XX7NKA==", "storedKey" : "pns2OxgR+zfvJJL07to6PSvhc83R8YfnbrRQXh9xSKo=", "serverKey" : "2DKiqzYZHGszCHsb75VJbjqOrP/LfaEQMkdORPejIPI=" } }, "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" } ] }
Check this
> db.createUser({ user: "mongoadmin" , pwd: "mongoadmin", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})
Successfully added user: {
"user" : "mongoadmin",
"roles" : [
"userAdminAnyDatabase",
"dbAdminAnyDatabase",
"readWriteAnyDatabase"
]
}
Check out these
> db.createUser( { user:"siteUserAdmin",pwd:"password",roles:["userAdminAnyDatabase"]})
Successfully added user: { "user" : "siteUserAdmin", "roles" : [ "userAdminAnyDatabase" ] }
> db.createUser( { user:"siteRootAdmin",pwd:"password", roles:["userAdminAnyDatabase","readWriteAnyDatabase","dbAdminAnyDatabase","clusterAdmin"]});
Successfully added user: {
"user" : "siteRootAdmin",
"roles" : [
"userAdminAnyDatabase",
"readWriteAnyDatabase",
"dbAdminAnyDatabase",
"clusterAdmin"
]
}
It is said the MongoDB Replica set needs both user account and keyfile. Keyfile seems for authentication between servers in the replica set, not for login in.
All the configurations are listed here
https://docs.mongodb.com/manual/reference/configuration-options/
Try the settings as follow:
storage:
dbPath: "/data/db/mongodb"
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: "/var/log/mongodb/mongod.log"
logAppend: true
timeStampFormat: iso8601-utc
replication:
oplogSizeMB: 10240
replSetName: "sillycat"
processManagement:
fork: true
net:
bindIp: 0.0.0.0
port: 27017
security:
keyFile: "/opt/mongodb/keyfile.key"
authorization: "enabled"
Check version
> mongod -version
db version v4.2.1
git version: edf6d45851c0b9ee15548f0f847df141764a317e
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
distmod: rhel70
distarch: x86_64
target_arch: x86_64
Create the keyfile, we usually generate the keyfile on one server, copy that to other servers.
> openssl rand -base64 90 -out ./keyfile.key
Change the permission
> chmod 600 ./keyfile.key
Copy the file to other machines, make sure all 3 nodes having the same keyfile
> sudo rm -fr /data/db/mongodb/*
Facing some failure, because of the previous database data directory is keeping some old configurations. Clear that directories, and restart, it works fine.
We can always check the logging here
> tail -f /var/log/mongodb/mongod.log
> mongod -f conf/mongodb.conf
The final configurations are as follow:
> cat conf/mongodb.conf
storage:
dbPath: /data/db/mongodb
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: /var/log/mongodb/mongod.log
logAppend: true
replication:
oplogSizeMB: 10240
replSetName: sillycat
processManagement:
fork: true
net:
bindIp: 0.0.0.0
port: 27017
security:
keyFile: /opt/mongodb/keyfile.key
authorization: enabled
Disable the security—>authorization and security—>keyFile ,restart the services again
Connect to the master server again
> mongo --host rancher-home --port 27017
> rs.status()
{
"operationTime" : Timestamp(0, 0),
"ok" : 0,
"errmsg" : "no replset config has been received",
"code" : 94,
"codeName" : "NotYetInitialized",
"$clusterTime" : {
"clusterTime" : Timestamp(0, 0),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
> rs.initiate()
sillycat:SECONDARY> rs.conf()
sillycat:PRIMARY> rs.add("rancher-worker1:27017")
sillycat:PRIMARY> rs.add("rancher-worker2:27017")
That will recreate the master and 2 replicas.
Create some important user
User root as root role
> db.createUser({user:"root",pwd:"123456",roles:[{role:"root",db:"admin"}] });
sillycat:PRIMARY> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
sillycat:PRIMARY> use admin
switched to db admin
User admin is admin of any database
> db.createUser({user:"admin", pwd:"admin", roles:[{role: "userAdminAnyDatabase", db:"admin" }]})
It works
> sillycat:PRIMARY> db.auth("admin","admin")
1
Create a new database
> sillycat:PRIMARY> use testdb1
switched to db testdb1
Create db owner
> sillycat:PRIMARY> db.createUser({user:"carl",pwd:"123456",roles:[{role:"dbOwner",db:"testdb1"}] })
It works well
sillycat:PRIMARY> db.auth("carl","123456")
1
Shutdown all the services
> mongo --host rancher-home --port 27017
> mongo --host rancher-worker1 --port 27017
> mongo --host rancher-worker2 --port 27017
> sillycat:PRIMARY> use admin
sillycat:PRIMARY> db.shutdownServer()
Need to use local to connect to shutdown the service
> mongo --host localhost --port 27017
Enable all the configurations
security:
keyFile: /opt/mongodb/keyfile.key
authorization: enabled
Start the service again
> mongod -f conf/mongodb.conf
Check admin first
> mongo --host rancher-home --port 27017 -uadmin -padmin --authenticationDatabase admin
Check other db
> mongo --host rancher-home --port 27017 -ucarl -p123456 --authenticationDatabase testdb1
sillycat:PRIMARY> use testdb1
sillycat:PRIMARY> db.users.insert({name:"Carl", age:31})
sillycat:PRIMARY> db.users.find();
{ "_id" : ObjectId("5dcf23e43a8ac5e8fb8bd004"), "name" : "Carl", "age" : 31 }
On slave
> mongo --host rancher-worker1 --port 27017 -ucarl -p123456 --authenticationDatabase testdb1
sillycat:SECONDARY> rs.slaveOk();
sillycat:SECONDARY> db.users.find();
{ "_id" : ObjectId("5dcf23e43a8ac5e8fb8bd004"), "name" : "Carl", "age" : 31 }
Some other command
sillycat:SECONDARY> use testdb1
switched to db testdb1
sillycat:SECONDARY> show dbs
testdb1 0.000GB
sillycat:SECONDARY> show collections
users
Check current db
> sillycat:SECONDARY> db
test
References:
https://docs.mongodb.com/manual/core/authentication/
https://stackoverflow.com/questions/20539376/a-mongodb-useradminanydatabase-user-cannot-admin-users-in-any-database-why
http://www.dba86.com/docs/mongo/2.4/tutorial/deploy-replica-set-with-auth.html
https://stackoverflow.com/questions/38524150/mongodb-replica-set-with-simple-password-authentication
https://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/
https://github.com/johnnian/Blog/issues/8
https://dba.stackexchange.com/questions/82591/sample-yaml-configuration-files-for-mongodb
https://nutao.github.io/2017/07/27/Mongodb-%E9%9B%86%E7%BE%A4%E8%AE%A4%E8%AF%81%EF%BC%88KeyFile%EF%BC%89/
https://www.cnblogs.com/cswuyg/p/5869256.html
Started the mongo cluster first
Connect to it
> mongo -host rancher-worker2 -port 27017
> rs.slaveOk();
> db.users.find();
Check DB
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
test 0.000GB
Switch to use admin
> use admin
switched to db admin
check if there is any users in DB
> db.system.users.find();
sillycat:PRIMARY>
No users, so I add one user there
https://docs.mongodb.com/manual/tutorial/create-users/
> use admin
switched to db admin
> db.createUser({user: "carl",pwd: "password",roles:[{role: "userAdminAnyDatabase", db:"admin"}]})
Successfully added user: {
"user" : "carl",
"roles" : [
{
"role" : "userAdminAnyDatabase",
"db" : "admin"
}
]
}
Verify my auth
> db.auth("carl","password")
1
Exit and change the configuration for mongodb
> vi conf/mongodb.conf
auth = true
Kill the mongo process and start them again one by one
> mongod -f conf/mongodb.conf
In theory, it should be good to go now.
Wrong password will fail
> mongo --host rancher-home --port 27017 -ucarl -padfasdf --authenticationDatabase admin
Good password will be good
> mongo --host rancher-home --port 27017 -ucarl -ppassword --authenticationDatabase admin
> rs.slaveOk();
sillycat:OTHER>
> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
test 0.000GB
> use admin
Check Users
> db.system.users.find()
{ "_id" : "admin.carl", "userId" : UUID("73415070-d63d-4377-ac3f-a247521a9d43"), "user" : "carl", "db" : "admin", "credentials" : { "SCRAM-SHA-1" : { "iterationCount" : 10000, "salt" : "pYlkO1HuxIyKAM9fmnWZvQ==", "storedKey" : "cDocJ/FMaE3+T/KA02kQ+z2tjas=", "serverKey" : "BZe3saf4s7eqzc+Ks6kmvuJRTLw=" }, "SCRAM-SHA-256" : { "iterationCount" : 15000, "salt" : "CfET/OxJEo2eRnJufeaVKSmEy+7U89m7XX7NKA==", "storedKey" : "pns2OxgR+zfvJJL07to6PSvhc83R8YfnbrRQXh9xSKo=", "serverKey" : "2DKiqzYZHGszCHsb75VJbjqOrP/LfaEQMkdORPejIPI=" } }, "roles" : [ { "role" : "userAdminAnyDatabase", "db" : "admin" } ] }
Check this
> db.createUser({ user: "mongoadmin" , pwd: "mongoadmin", roles: ["userAdminAnyDatabase", "dbAdminAnyDatabase", "readWriteAnyDatabase"]})
Successfully added user: {
"user" : "mongoadmin",
"roles" : [
"userAdminAnyDatabase",
"dbAdminAnyDatabase",
"readWriteAnyDatabase"
]
}
Check out these
> db.createUser( { user:"siteUserAdmin",pwd:"password",roles:["userAdminAnyDatabase"]})
Successfully added user: { "user" : "siteUserAdmin", "roles" : [ "userAdminAnyDatabase" ] }
> db.createUser( { user:"siteRootAdmin",pwd:"password", roles:["userAdminAnyDatabase","readWriteAnyDatabase","dbAdminAnyDatabase","clusterAdmin"]});
Successfully added user: {
"user" : "siteRootAdmin",
"roles" : [
"userAdminAnyDatabase",
"readWriteAnyDatabase",
"dbAdminAnyDatabase",
"clusterAdmin"
]
}
It is said the MongoDB Replica set needs both user account and keyfile. Keyfile seems for authentication between servers in the replica set, not for login in.
All the configurations are listed here
https://docs.mongodb.com/manual/reference/configuration-options/
Try the settings as follow:
storage:
dbPath: "/data/db/mongodb"
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: "/var/log/mongodb/mongod.log"
logAppend: true
timeStampFormat: iso8601-utc
replication:
oplogSizeMB: 10240
replSetName: "sillycat"
processManagement:
fork: true
net:
bindIp: 0.0.0.0
port: 27017
security:
keyFile: "/opt/mongodb/keyfile.key"
authorization: "enabled"
Check version
> mongod -version
db version v4.2.1
git version: edf6d45851c0b9ee15548f0f847df141764a317e
OpenSSL version: OpenSSL 1.0.1e-fips 11 Feb 2013
allocator: tcmalloc
modules: none
build environment:
distmod: rhel70
distarch: x86_64
target_arch: x86_64
Create the keyfile, we usually generate the keyfile on one server, copy that to other servers.
> openssl rand -base64 90 -out ./keyfile.key
Change the permission
> chmod 600 ./keyfile.key
Copy the file to other machines, make sure all 3 nodes having the same keyfile
> sudo rm -fr /data/db/mongodb/*
Facing some failure, because of the previous database data directory is keeping some old configurations. Clear that directories, and restart, it works fine.
We can always check the logging here
> tail -f /var/log/mongodb/mongod.log
> mongod -f conf/mongodb.conf
The final configurations are as follow:
> cat conf/mongodb.conf
storage:
dbPath: /data/db/mongodb
directoryPerDB: true
journal:
enabled: true
systemLog:
destination: file
path: /var/log/mongodb/mongod.log
logAppend: true
replication:
oplogSizeMB: 10240
replSetName: sillycat
processManagement:
fork: true
net:
bindIp: 0.0.0.0
port: 27017
security:
keyFile: /opt/mongodb/keyfile.key
authorization: enabled
Disable the security—>authorization and security—>keyFile ,restart the services again
Connect to the master server again
> mongo --host rancher-home --port 27017
> rs.status()
{
"operationTime" : Timestamp(0, 0),
"ok" : 0,
"errmsg" : "no replset config has been received",
"code" : 94,
"codeName" : "NotYetInitialized",
"$clusterTime" : {
"clusterTime" : Timestamp(0, 0),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
> rs.initiate()
sillycat:SECONDARY> rs.conf()
sillycat:PRIMARY> rs.add("rancher-worker1:27017")
sillycat:PRIMARY> rs.add("rancher-worker2:27017")
That will recreate the master and 2 replicas.
Create some important user
User root as root role
> db.createUser({user:"root",pwd:"123456",roles:[{role:"root",db:"admin"}] });
sillycat:PRIMARY> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
sillycat:PRIMARY> use admin
switched to db admin
User admin is admin of any database
> db.createUser({user:"admin", pwd:"admin", roles:[{role: "userAdminAnyDatabase", db:"admin" }]})
It works
> sillycat:PRIMARY> db.auth("admin","admin")
1
Create a new database
> sillycat:PRIMARY> use testdb1
switched to db testdb1
Create db owner
> sillycat:PRIMARY> db.createUser({user:"carl",pwd:"123456",roles:[{role:"dbOwner",db:"testdb1"}] })
It works well
sillycat:PRIMARY> db.auth("carl","123456")
1
Shutdown all the services
> mongo --host rancher-home --port 27017
> mongo --host rancher-worker1 --port 27017
> mongo --host rancher-worker2 --port 27017
> sillycat:PRIMARY> use admin
sillycat:PRIMARY> db.shutdownServer()
Need to use local to connect to shutdown the service
> mongo --host localhost --port 27017
Enable all the configurations
security:
keyFile: /opt/mongodb/keyfile.key
authorization: enabled
Start the service again
> mongod -f conf/mongodb.conf
Check admin first
> mongo --host rancher-home --port 27017 -uadmin -padmin --authenticationDatabase admin
Check other db
> mongo --host rancher-home --port 27017 -ucarl -p123456 --authenticationDatabase testdb1
sillycat:PRIMARY> use testdb1
sillycat:PRIMARY> db.users.insert({name:"Carl", age:31})
sillycat:PRIMARY> db.users.find();
{ "_id" : ObjectId("5dcf23e43a8ac5e8fb8bd004"), "name" : "Carl", "age" : 31 }
On slave
> mongo --host rancher-worker1 --port 27017 -ucarl -p123456 --authenticationDatabase testdb1
sillycat:SECONDARY> rs.slaveOk();
sillycat:SECONDARY> db.users.find();
{ "_id" : ObjectId("5dcf23e43a8ac5e8fb8bd004"), "name" : "Carl", "age" : 31 }
Some other command
sillycat:SECONDARY> use testdb1
switched to db testdb1
sillycat:SECONDARY> show dbs
testdb1 0.000GB
sillycat:SECONDARY> show collections
users
Check current db
> sillycat:SECONDARY> db
test
References:
https://docs.mongodb.com/manual/core/authentication/
https://stackoverflow.com/questions/20539376/a-mongodb-useradminanydatabase-user-cannot-admin-users-in-any-database-why
http://www.dba86.com/docs/mongo/2.4/tutorial/deploy-replica-set-with-auth.html
https://stackoverflow.com/questions/38524150/mongodb-replica-set-with-simple-password-authentication
https://docs.mongodb.com/manual/tutorial/deploy-replica-set-with-keyfile-access-control/
https://github.com/johnnian/Blog/issues/8
https://dba.stackexchange.com/questions/82591/sample-yaml-configuration-files-for-mongodb
https://nutao.github.io/2017/07/27/Mongodb-%E9%9B%86%E7%BE%A4%E8%AE%A4%E8%AF%81%EF%BC%88KeyFile%EF%BC%89/
https://www.cnblogs.com/cswuyg/p/5869256.html
发表评论
-
Update Site will come soon
2021-06-02 04:10 1609I am still keep notes my tech n ... -
Stop Update Here
2020-04-28 09:00 260I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 430NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 310Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 321Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 291Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 378Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 373Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 327Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 397VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 334Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 415NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 359Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 292Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 208GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 390GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 275GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 264Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 259Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 252Serverless with NodeJS and Tenc ...
相关推荐
在配置文件mongod.conf 中加入 auth = true 如果你开启了--rest参数,甚至可以直接通过web界面查询数据,执行mongod命令。 2、关闭网页管理 在配置文件mongod.conf 中加入nohttpinterface=true,rest = false 不加会...
我解释了如何选择OAuth 2.0和MongoDB来构建可在微服务体系结构中使用的Single Sign On Auth服务器。 1.第一步。 运行sso-auth-client应用程序。 并尝试访问 。 不传递任何标题就返回此 2.第二步。 运行sso-auth-...
Chapter 6: Security and Auth in Node.js Chapter 7: Boosting Node.js and MongoDB with Mongoose Chapter 8: Building Node.js REST API Servers with Express.js and Hapi Chapter 9: Real-Time Apps with ...
基于spring-security的无状态宁静架构要求jdk1.8 弹簧 4.1+ 弹簧安全 3.2+ spring-data-mongodb 1.6+ 缓存 2.9+ Hibernate 4.3+ 时髦 2.3+如何首先,运行测试包 ServiceTest.seed() 方法种子数据。 使用uid和passwd...
设置 MongoDB 数据库的...# Turn on/off security. Off is currently the default #noauth = true #auth = true 去掉 #auth=true 前的注释 # auth = true 重启 mongodb 服务 service mongodb restart 使用 mongo she
验证码愚简单的身份验证该项目包含的代码显示了如何使用MongoDB在Node.js Web应用程序中实现自己的用户身份验证。 该项目旨在与我在Twilio Signal 2017上的演讲保持一致。该演讲从头开始逐步引导您进行身份验证的...
安装数据库运行brew install mongo 运行brew services start mongodb 运行brew install neo4j 配置neo4j,编辑/usr/local/Cellar/neo4j/3.2.0/libexec/conf/neo4j.conf 设置dbms.security.auth_enabled=false 运行...
spring boot 实践学习案例,与其它组件结合如 mybatis、jpa、dubbo、redis、mongodb、memcached、kafka、rabbitmq、activemq、elasticsearch、security、shiro等 #### Spring Boot 版本 - 2.0.3.RELEASE #### 模块...
适用于NodeJS的REST API样板,它使用以下基本实践的集合:Auth,Security,RESTful资源,API文档,Testing and Logging。 使用MongoDB作为其数据库,并使用Passport进行(jwt)身份验证。 使用的库和工具 ,, ...
注意: AND, OR, and NOT 只能大写. - 通配符 ? 表示单个字符 星号表示0个和多个字符 ``` source:*.org source:exam?le.org source:exam?le.* ``` 注意:默认首字母不能使用通配符,因为这样会使用大量的内存;...
本系统支持分布式多节点部署,分布式环境下会话共享并没有使用常见的redis方案,而是采用了MongoDB存储。其优点是方便查看和管理会话信息。另外本项目提供用户管理,用户权限管理,单点登录客户端信息管理,系统菜单...
2fa节点 使用nodejs进行两因素身份验证 :floppy_disk: 安装 # clone the repo $ git clone https://github.com/ThalKod/node-2fa.git # install the requirements $ npm install 用法 npm start
使用的技术节点JS 表示EJS MongoDB的猫鼬护照智威汤逊节点邮件程序先决条件吉特节点JS 命令行界面安装克隆最新的存储库进入项目目录cd nodejs-auth 安装NPM依赖项npm install 然后只需启动您的应用npm start 服务器...
MinBox Logging MinBox Logging是一款分布式、零侵入式的链路日志分析框架,支持SpringCloud微服务架构下配置使用,内部封装了...对外提供安全的日志上报功能,通过整合Spring Security来完成Basic Auth基础认
├── mall - auth -- 基于Spring Security Oauth2的统一的认证中心 ├── mall - gateway -- 基于Spring Cloud Gateway的微服务API网关服务 ├── mall - monitor -- 基于Spring Boot Admin的微服务监控中心 ├...
带有DB集成JWT令牌auth的REST Apis的Spring安全性。 带有eureka服务器和带有api-gateway的eureka客户端的示例spring boot微服务。 使用kafka asa事件总线的Spring Cloud事件驱动示例。 示例spring boot项目。 ...
它与Redis ,进程Memory , Cluster或PM2 , Memcached , MongoDB , MySQL , PostgreSQL一起使用,并允许在单个进程或分布式环境中控制请求速率。 原子增量。 内存或分布式环境中的所有操作都针对竞争条件使用...