cloud-login

Add a Fauna endpoint with login credentials.

Syntax

fauna cloud-login [OPTIONS]

Description

The cloud-login command prompts for Fauna credentials and, if authentication is successful, creates a cloud endpoint in the configuration file, which is used to query a Fauna database.

Command line prompts help create endpoints that work with Region Groups and with secrets for existing databases:

Prompt Description

Endpoint alias prefix

To access databases in multiple Region Groups, this prompt requests a prefix that can be applied to multiple Region Group endpoints.

How do you prefer to authenticate?

Authentication preference:

Email and Password

Prompted for Fauna Dashboard email-password login credentials.

Secret

Use the existing database secret, similar to how your client applications authenticate.

When you choose this option, you are prompted for a secret, which is the authentication bearer token acquired by creating a key or token. See Access control cookbook.

You are then prompted for which Region Group to connect to. The secret is associated with a database in a region. If you choose incorrectly, a could not connect error is returned, and you are prompted for your secret again.

Multi-factor authentication

When multifactor authentication (MFA) is enabled for your account, you’re prompted for the current, time-based multifactor authentication code. Get the current code in your authenticator app. If you enter an incorrect code, cloud-login exits with an error.

Default endpoint

When the configuration file has an existing endpoint, you are asked if the new endpoint to be created by this command should be the default endpoint.

Options

Option Description

--domain=<domain>

(Optional) Fauna server domain, which is the Fauna hostname.
Default = db.fauna.com

--endpoint=<name>

(Optional) Endpoint name to use for the command.

--port=<number>

(Optional) Connection port.
Default = 8443

--scheme=<scheme>

(Optional) Connection scheme. Must be one of:
       https (default)
       http

--secret=<secret>

(Optional) Secret to use to connect to a database.

--timeout=<integer>

(Optional) connection timeout, in milliseconds. When the interval elapses, fauna-shell times out and displays an error.
Default = 0, wait indefinitely until a response is received.

--version

(Optional) Fauna Query Language version
       v10 = (default) FQL v10
       v4 = FQL v4

Examples

The following example demonstrates the use of cloud-login and the prompts for email/secret and password:

fauna cloud-login
? The endpoint alias prefix (to combine with a region): cloud
? How do you prefer to authenticate? Email and Password
? Email address: docs@fauna.com
? Password: [hidden]
? Enter your multi-factor authentication code 377277
? Endpoints created. Would you like to set one of them as default? Keep 'cloud'
endpoint as default
Endpoint 'cloud' set as default endpoint.

After a successful login, your configuration file now has a cloud endpoint that includes the secret to access your top-level database. The configuration file should resemble:

default=cloud

[cloud]
domain=db.fauna.com
scheme=https
secret=fnADS@PxN@2CE@n7z@kDa4_p6Z@fIBaZm@Qt@bYT

See also

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!