Skip to content

add-direct-access-token ​

Available in4.21.0 +

Creates a direct access token that gives a recipient access to a share. A direct access token is what the web interface calls a direct access (Direct Accesses tab of a share).

Syntax:

shell
sfiler-admin [options] add-direct-access-token [command options]
Command optionsRequired/OptionalDescription
-nRequiredThe name of the share to which the token gives access.
-eOptionalThe email address of the recipient. Required when the security type is EMAIL_OTP.
-lOptionalThe language of the token, among the languages enabled on the instance (en, fr, es, de, it). Default: the language of the user running the command
-tOptionalThe name of the theme of the token. The theme must exist and be active.
-stOptionalThe security type: NONE, PASSWORD, SMS_OTP or EMAIL_OTP (see below). Default: NONE
-pwOptionalThe password. Required when the security type is PASSWORD.
-pnOptionalThe phone number that receives the access code. Required when the security type is SMS_OTP (E.164 or international format, ex: +15145556666).
-pmOptionalThe name of the permission granted on the share, as displayed by the list-permissions command (ex: permission.name.2). The name is not case-sensitive. Default: permission.name.1 (Download, List, Delete Own Files)

The security types are:

  • NONE: no additional verification. It is refused when the Recipient Password Policy that applies requires a password.
  • PASSWORD: the recipient enters the password given by -pw, which must comply with the Recipient Password Policy that applies.
  • SMS_OTP: the recipient receives a one-time access code by SMS at the number given by -pn. It requires an SMS provider.
  • EMAIL_OTP: the recipient receives a one-time access code at the email address of the token. No value is needed besides that address.

The command must be run by an administrator or by an administrator of the share. When the token has an email address, the recipient is notified by email.

The command displays the identifier of the token (Identifier:), used by the other commands with -i, and its access code (Code:) when there is one. Both lines are displayed even in quiet mode (-q), so that a script can read them.

Example:

This command creates a token for the share "my-share", protected by a code sent by email, which grants the permission.name.2 permission.

shell
sfiler-admin.sh -l my-admin -p 012345 -s https://www.example.com/sfiler/server/ add-direct-access-token -n "my-share" -e "recipient@example.com" -st EMAIL_OTP -pm permission.name.2
shell
sfiler-admin.exe -l my-admin -p 012345 -s https://www.example.com/sfiler/server/ add-direct-access-token -n "my-share" -e "recipient@example.com" -st EMAIL_OTP -pm permission.name.2