FTP authentication

All Plugins / Auth / Ftp

Identity Card

StatusCore
Plugin LabelFTP authentication
Short DescriptionAuthenticate users by validating their credentials against an FTP server.
Plugin Identifierauth.ftp
AuthorCharles du Jeu
Urldocs/references/plugins/auth/ftp
Dependenciesaccess.ftp

Documentation

This one will test the credentials directly against an FTP server, and create the user if he is recognized. There are two way to make it works, but in both case it must be associated to a specific repository. You need to know the repository ID, so you should define it manually inside the bootstrap_repositories.php file, or create it via the GUI and copy the "unique id" column displayed in the repository list. In both case, the transmission from the user's credentials from the "auth" driver to the "access" repository will be handled via the "SESSION_CREDENTIAL" mechanism. Thus you have to make sure in the Settings > Core Options > Common "Auth" options that "Store Credentials in Session" is set to true.

The first use case is when you already know the FTP server to which you want to connect. In that case, you must define a repository using the access.ftp driver with all the necessary FTP connexion informations, can be something like this inside conf/boostrap_repositories.php :

    $REPOSITORIES["predefined_ftp"] = array(
        "DISPLAY"       => "Ajxp FTP Server",
        "DRIVER"        => "ftp",
        "DRIVER_OPTIONS"=> array(
            "FTP_HOST"       => "ftp.myserver.com",
            "FTP_PORT"      => "21",
            "DEFAULT_RIGHTS"    => "rw",
            "USE_SESSION_CREDENTIALS"   => true,
        )
    );
    
Here the unique id is "predefined_ftp", then configure the AUTH_DRIVER in boostrap_plugins.php like this :
    "AUTH_DRIVER" => array(
        "NAME"		=> "ftp",
        "OPTIONS"	=> array(
            "LOGIN_REDIRECT"		=> false,
            "REPOSITORY_ID"		    => "predefined_ftp",
            "ADMIN_USER"		    => "admin",
            "FTP_LOGIN_SCREEN"      => false,
            "AUTOCREATE_AJXPUSER" 	=> true,
            "TRANSMIT_CLEAR_PASS"	=> true,
        )
    ),
    

The second possible case is when you want to let your user do whatever they want and connect any remote FTP server, transforming Pydio into a powerful "netFtp" client. In that case, you'll configure the predefine repository without the FTP_XXX options but with a DYNAMIC_FTP option set to true, and the Auth driver will have the option FTP_LOGIN_SCREEN set to true, which will override the standard login dialog and add a more complex one with all FTP connexion information :

Instance parameters

LabelDescriptionTypeDefault
Test connection
TEST_CONNEXION
Test connection to the FTP serverButtonauth.ftp
FTP Login Screen *
FTP_LOGIN_SCREEN
Whether to display a generic 'FTP connection' dialog at startup (allowing users to enter their own host/port data) or the standard login dialog.Booleanfalse
Workspace *
REPOSITORY_ID
ID of the workspace used to validate credentialsSelect (json_list:list_all_repositories_json)
Auth Driver Commons
Auto Create User
AUTOCREATE_AJXPUSER
When set to true, the user object is created automatically if the authentication succeed. Used by remote authentication systems.Booleanfalse
Login Redirect
LOGIN_REDIRECT
If set to a given URL, the login action will not trigger the display of login screen but redirect to this URL.String
Administrator Login
AJXP_ADMIN_LOGIN
For exotic auth drivers, an user ID that must be considered as admin by default.String
Auto apply role
AUTO_APPLY_ROLE
For multiple authentication, apply this role to users authenticated via this driverString