Synopsis
fcli fod session login [-k] [--connect-timeout=<connectTimeout>] [--socket-timeout=<socketTimeout>] --url=<url> [[-h] [--env-prefix=<prefix>] [--log-file=<logFile>] [--log-level=<logLevel>] [--log-mask=<level>] [--debug]] [[-o=<type+args>] [--style*=<style>,…]… ] [--to-file=<outputFile>_]] ([--scopes=<scopes> [,<scopes>…]]… [-t=<tenant>] -u=<user> -p [=<password>]) | (--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
- -t, --tenant=<tenant>
-
FoD tenant; required when authenticating with user credentials, ignored for client credentials.
- -u, --user=<user>
-
FoD user.
- -p, --password[=<password>]
-
FoD password.
- --client-id=<clientId>
-
FoD client id.
- --client-secret[=<clientSecret>]
-
FoD client secret.
- --url=<url>
-
FoD URL, for example https://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 (also see documentation link below)
- -o, --output=<type+args>
-
Select output type (csv, table, expr, json, xml, yaml) and optional type arguments.
- *--style*=<style>,…
-
Select output style: header, no-header, pretty, no-pretty, flat, no-flat, array, single, border, no-border, md-border, wrap, no-wrap, fast-output, no-fast-output.
- --store=<var>[:<prop>]
-
Store JSON results in an fcli variable for later reference.
- --to-file=<outputFile>
-
Write output to the specified file.
Generic fcli options (also see documentation link below)
- -h, --help
-
Use 'fcli [command] -h' to display help for fcli (sub-)commands.
- --env-prefix=<prefix>
-
Prefix for resolving default option values. Default value: FCLI_DEFAULT.
- --log-file=<logFile>
-
Write log output to file. Default: ./fcli.log if logging is enabled.
- --log-level=<logLevel>
-
Set logging level: TRACE, DEBUG, INFO, WARN, ERROR, NONE.
- --log-mask=<level>
-
Log mask level: high, medium, low, none. Default: medium. Masking is done on a best-effort basis; no guarantee that all sensitive data will be masked.
- --debug
-
Enable collection of debug logs.