/** * Authenticates if there is an authenticator, else returns null. * * @param opts The FileSystemOptions. * @param authenticatorTypes An array of types describing the data to be retrieved. * @return A UserAuthenticationData object containing the data requested. */ public static UserAuthenticationData authenticate(final FileSystemOptions opts, final UserAuthenticationData.Type[] authenticatorTypes) { final UserAuthenticator auth = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(opts); return authenticate(auth, authenticatorTypes); }
/** * Authenticates if there is an authenticator, else returns null. * * @param opts The FileSystemOptions. * @param authenticatorTypes An array of types describing the data to be retrieved. * @return A UserAuthenticationData object containing the data requested. */ public static UserAuthenticationData authenticate(final FileSystemOptions opts, final UserAuthenticationData.Type[] authenticatorTypes) { final UserAuthenticator auth = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(opts); return authenticate(auth, authenticatorTypes); }
/** * Authenticates if there is an authenticator, else returns null. * * @param opts The FileSystemOptions. * @param authenticatorTypes An array of types describing the data to be retrieved. * @return A UserAuthenticationData object containing the data requested. */ public static UserAuthenticationData authenticate(final FileSystemOptions opts, final UserAuthenticationData.Type[] authenticatorTypes) { final UserAuthenticator auth = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(opts); return authenticate(auth, authenticatorTypes); }
/** * Authenticates if there is an authenticator, else returns null. * * @param opts The FileSystemOptions. * @param authenticatorTypes An array of types describing the data to be retrieved. * @return A UserAuthenticationData object containing the data requested. */ public static UserAuthenticationData authenticate(final FileSystemOptions opts, final UserAuthenticationData.Type[] authenticatorTypes) { final UserAuthenticator auth = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(opts); return authenticate(auth, authenticatorTypes); }
SshClient con = provider.createClient(config); if (username == null || password == null) { UserAuthenticator ua = DefaultFileSystemConfigBuilder.getInstance().getUserAuthenticator(fileSystemOptions); UserAuthenticationData data = ua.requestAuthentication(new UserAuthenticationData.Type[] { UserAuthenticationData.USERNAME, UserAuthenticationData.PASSWORD });