Authentication Connection Tab“身份验证连接”选项卡
On this page本页内容
The Authentication tab allows you to connect to deployments that require authentication. “身份验证”选项卡允许您连接到需要身份验证的部署。To learn about authentication mechanisms within MongoDB, see Authentication Mechanisms.要了解MongoDB中的身份验证机制,请参阅身份验证机制。
Procedure过程
Click the Authentication tab.单击“身份验证”选项卡。
Select your authentication method from the following options:从以下选项中选择您的身份验证方法:
Username / Password用户名/密码
Provide the following information:提供以下信息:
- Username
- Password
- (Optional)
Authentication Database身份验证数据库 Authentication Mechancism:认证机制:Default违约TheDefault
setting selects the first authentication mechanism supported by the server according to an order of preference.Default
设置根据偏好顺序选择服务器支持的第一个身份验证机制。With the在Default
setting, MongoDB tries to authenticate using the following mechanisms in the order they are listed:Default
设置下,MongoDB尝试按照列出的顺序使用以下机制进行身份验证:SCRAM-SHA-256
SCRAM-SHA-1
MONGODB-CR
- SCRAM-SHA-1
- SCRAM-SHA-256
X.509
Select X.509 if the deployment uses X.509 as its authentication mechanism.如果部署使用X.509作为其身份验证机制,请选择“X.509”。
X.509 Authentication requires a client certificate. To enable TLS and add a client certificate, see the TLS / SSL tab in Compass.X.509身份验证需要客户端证书。要启用TLS并添加客户端证书,请参阅Compass中的TLS/SSL选项卡。
Kerberos
Select Kerberos if the deployment uses Kerberos as its authentication mechanism.如果部署使用Kerberos作为其身份验证机制,请选择“Kerberos”。
Provide the following information:提供以下信息:
mongod and mongos instance (or exe or exe on Windows) must have an associated service name. The default is mongodb .mongod 和mongos 实例(或Windows上的exe或exe)都必须有一个关联的服务名称。默认值是mongodb 。 | |||||||
(cname) when constructing the principal for MongoDB Compass.cname )的规范化形式。 | |||||||
| |||||||
showKerberosPasswordField 项。 |
Authenticate as a Different Kerberos User on Windows在Windows上作为不同的Kerberos用户进行身份验证
When you authenticate with Kerberos on Windows, the Principal you specify must match the principal of the security context that Compass is running. 在Windows上使用Kerberos进行身份验证时,指定的主体必须与Compass正在运行的安全上下文的“主体”匹配。Normally, this is the logged-in user who is running Compass.通常,这是正在运行Compass的登录用户。
To authenticate as a different Kerberos user, run MongoDB Compass as the chosen user and specify the Principal for that user. 要以不同的Kerberos用户身份进行身份验证,请以所选用户身份运行MongoDB Compass,并为该用户指定“Principal”。To run MongoDB Compass as a different user, either:要以不同用户身份运行MongoDB Compass,请执行以下任一操作:
Hold Shift and right-click the MongoDB Compass program icon to select Run as a different user.按住Shift键并右键单击MongoDB Compass程序图标,选择“以其他用户身份运行”。Use the使用runas
command-line tool. For example, the following command runs MongoDB Compass as a user namedadmin
:runas
命令行工具。例如,以下命令以名为admin
的用户身份运行MongoDB Compass:runas /profile /user:mymachine\admin <path to MongoDB Compass>
After you start MongoDB Compass as the chosen user, to authenticate against your Kerberos-enabled MongoDB deployment, specify the Principal for the corresponding user.在您作为所选用户启动MongoDB Compass之后,要根据启用Kerberos的MongoDB部署进行身份验证,请为相应的用户指定“Principal”。
LDAP
Select LDAP if the deployment uses LDAP as its authentication mechanism.如果部署使用LDAP作为其身份验证机制,请选择“LDAP”。
Provide the following information:提供以下信息:
- Username
- Password
AWS IAM
Select AWS IAM if the deployment uses AWS IAM如果部署使用“AWS IAM”作为其身份验证机制,请选择AWS IAM as its authentication mechanism.
。
The following fields are optional as they can be defined on your platform using their respective AWS IAM environment variables. 以下字段是可选的,因为它们可以在您的平台上使用各自的AWS IAM环境变量进行定义。MongoDB Compass will use these environment variable values to authenticate; you do not need to specify them in the connection string.MongoDB Compass将使用这些环境变量值进行身份验证;您不需要在连接字符串中指定它们。
- (Optional) AWS Access Key Id
- (Optional) AWS Secret Access Key
- (Optional) AWS Session Token
See also:
To disconnect from your deployment, see Disconnect from MongoDB.要断开与部署的连接,请参阅断开与MongoDB的连接。