fredcli user login
Logs a user into the FRED Cloud environment using an authorization token.
Synopsis
Description
In order to perform fredcli
commands, a user must be authorized for the FRED
Cloud environment. This is currently done using an authorization token generated
from FRED Studio.
Once an authorization token is allocated, the environment must be initialized for
fredcli
using this command. The authorization token is provided as the only
argument for the command.
If successful, the authorization token is stored in a file config.json
in the directory .fredcli
of the user’s home directory. When other fredcli
commands are executed, the presence and validity of this authorization token
is verified before the requested command is executed.
Errors
If a token is already assigned, an error is shown if the --overwrite-existing
option is not provided.
Examples
The following example stores the authorization token in the environment.
$ fredcli user login eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIyY2JjY2UyZi0xMTZkLTQ4NjQtOGNkMi1kYTQ2OGQxMzBjYTAifQ.eyJpYXQiOjE2MjIyMjc0MzUsImp0aSI6IjMxZTAzMTg3LTc3ZTUtNDRiZS1iYTRmLTk5MjMxMjFiMDQwYyIsImlzcyI6Imh0dHBzOi8vc3NvLmRldi5lcGlzdGVtaXguY2xvdWQvYXV0aC9yZWFsbXMvZGV2ZWxvcG1lbnQiLCJhdWQiOiJodHRwczovL3Nzby5kZXYuZXBpc3RlbWl4LmNsb3VkL2F1dGgvcmVhbG1zL2RldmVs
$
If a taken was previously assigned, then the --overwrite-existing
option
should be used to indicate the token should be overwritten, as in the following.
$ fredcli user login eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICIyY2JjY2UyZi0xMTZkLTQ4NjQtOGNkMi1kYTQ2OGQxMzBjYTAifQ.eyJpYXQiOjE2MjIyMjc0MzUsImp0aSI6IjMxZTAzMTg3LTc3ZTUtNDRiZS1iYTRmLTk5MjMxMjFiMDQwYyIsImlzcyI6Imh0dHBzOi8vc3NvLmRldi5lcGlzdGVtaXguY2xvdWQvYXV0aC9yZWFsbXMvZGV2ZWxvcG1lbnQiLCJhdWQiOiJodHRwczovL3Nzby5kZXYuZXBpc3RlbWl4LmNsb3VkL2F1dGgvcmVhbG1zL2RldmVs --overwrite-existing
2021-06-11 20:46:11,428 WARNING:Overwriting existing FREDCLI authorization token
$