Synopsis
fcli fod session login [-k] [--connect-timeout=<connectTimeout>] [--socket-timeout=<socketTimeout>] --url=<url> [[-h] [--env-prefix=<envPrefix>] [--log-file=<logFile>] [--log-level=<logLevel>] [--log-mask=<logMaskLevel>] [--debug]] ] [--style=<outputStyleElements>_[, <outputStyleElements>…]]… ] [--to-file=<outputFile>_]] ([--scopes=<scopes>[,<scopes>…]]… -u=<user> -p [=<password>] -t=<tenant>) | (--client-id=<clientId> --client-secret[=<clientSecret>]) [[--fod-session=<sessionName>]]
Description
This command stores the FoD URL and authentication token in an encrypted session file in the fcli state data folder, for use by other 'fcli fod' commands to connect to the specified FoD instance. Option values may be passed on the command line or specified through environment variables (common for CI/CD pipeline use) as listed below.
For interactive use, you may choose to keep the session open until it expires. For CI/CD integrations and other automations, you should always invoke the logout command once work is complete to allow for any cleanup. On shared/non-containerized CI/CD systems, consider setting FCLI_STATE_DIR or FCLI_DATA_DIR environment variables to prevent unexpected interactions between different pipelines.
To avoid having to remember the various option values whenever you need to run the 'fcli fod session login' command, you may want to consider utilizing fcli’s support for providing default option values through environment variables; see fcli documentation for details. For example, you can set the FCLI_DEFAULT_FOD_URL and FCLI_DEFAULT_FOD_TENANT environment variables to avoid having to re-enter the FoD URL and tenant on every login. You can do the same for FoD credentials, but obviously should consider whether anyone else may be able to see the environment variable values. If you frequently connect to different FoD URLs or tenants, you can for example define PROD_FOD_URL, PROD_FOD_TENANT, DEV_FOD_URL, and DEV_FOD_TENANT environment variables, and then use the --env-prefix=PROD or --env-prefix=DEV option to select from which environment variables the default values should be retrieved.
Options
- --scopes=<scopes>[,<scopes>…]
-
FoD scopes to request. Default value: api-tenant
- -u, --user=<user>
-
FoD user.
- -p, --password[=<password>]
-
FoD password.
- -t, --tenant=<tenant>
-
FoD tenant.
- --client-id=<clientId>
-
FoD client id.
- --client-secret[=<clientSecret>]
-
FoD client secret.
- --url=<url>
-
FoD API URL, for example https://api.emea.fortify.com/.
- -k, --insecure
-
Disable SSL checks.
- --socket-timeout=<socketTimeout>
-
Socket timeout for this session, for example 30s (30 seconds), 5m (5 minutes). Default value: null.
- --connect-timeout=<connectTimeout>
-
Connection timeout for this session, for example 30s (30 seconds), 5m (5 minutes). Default value: null.
FoD session name options
- --fod-session=<sessionName>
-
Name for this FoD session. Default value: default.
Output options
- -o, --output=type[=<args>]
-
Specify output type and optional type arguments. Available output formats: csv, table, expr, json, xml, yaml. The 'expr' output format takes a string containing '{property}' placeholders, other output formats take an optional, comma-separated list of properties to include in the output.
- --style=<outputStyleElements>[,<outputStyleElements>…]
-
Comma-separated list of style elements to apply to the selected output format. Allowed values: header, no-header, pretty, no-pretty, flat, no-flat, array, single, border, no-border, md-border.
- --store=variableName[:<propertyNames>]
-
Store the JSON results of this command in a variable. Variables can be managed through the 'fcli util variable' command, and can be referenced using ::variable::[property] on any subsequent command.
- --to-file=<outputFile>
-
Write command output to the specified file instead of stdout.
Generic fcli options
- -h, --help
-
Show this help message and exit. Use 'fcli <command> -h' to display help for subcommands.
- --env-prefix=<envPrefix>
-
Environment variable prefix for resolving default option and parameter values. Default value: FCLI_DEFAULT.
- --log-file=<logFile>
-
File where logging data will be written. Defaults to fcli.log in current directory if --log-level is specified.
- --log-level=<logLevel>
-
Set logging level. Note that DEBUG and TRACE levels may result in sensitive data being written to the log file. Allowed values: TRACE, DEBUG, INFO, WARN, ERROR, NONE.
- --log-mask=<logMaskLevel>
-
Masking level to apply to logging data. Allowed values: high, medium, low, none. Default value: medium. Note that this is on a best-effort basis; you should always check log contents for sensitive data before sharing or publishing logs.
- --debug
-
Enable both fcli trace logging and collection of extra debugging data on applicable fcli actions and commands, for example enabling debug logging on tools invoked through fcli tool run commands, or enabling server-side debug log generation.