我不懂Java,而且我是CAS的新手。在CAS文档中有一个MongoDb-Authentication的例子(例如我的意思是我应该在cas.properties中编写的代码示例),但对于Mongo-Service-Management,没有任何示例。
cas.authn.mongo.collection.name=users
cas.authn.mongo.db.host=mongodb://user:password@ds061954.somewhere.com:61954/database
cas.authn.mongo.attributes=attribute1,attribute2
cas.authn.mongo.username.attribute=username
cas.authn.mongo.password.attribute=password
我这样做并且正在工作。 (虽然我没有改变第三行,但我不知道它是什么。)
mongodb.host=mongodb database url
mongodb.port=mongodb database port
mongodb.userId=mongodb userid to bind
mongodb.userPassword=mongodb password to bind
cas.service.registry.mongo.db=Collection name to store service definitions
现在我们有cas.service.registry.mongo.db
所以它可能是我们的数据库的名称,但他们说它是一个集合名称。这是一个错字吗?
url是否应包含端口,用户名和密码以及数据库的名称?
下面的代码就是我所做的,它使/cas
路径返回404 Not Found
!
mongodb.host=mongodb://myUserName:myPassword@ds061360.mlab.com:61360/mydb
mongodb.port=61360
mongodb.userId=mydb.myUserName
mongodb.userPassword=myPassword
cas.service.registry.mongo.db=services
mongodb.timeout=5000
正如我所说这使得CAS不可用,所以我尝试通过删除用户名和密码,数据库名称或网址中的端口来更改网址,它们都不起作用。
mlab.com中数据库用户的_id
为mydb.myUserName
,我将其更改为myUserName
,但这也没有帮助。你能提供一个例子或解释我做错了什么吗?
感谢您提供的任何帮助。