AJAX File Browser Authentication and SSL
The library supports SSL as well as any authentication supported by a user agent. In many cases you will rely on a user agent authentication mechanisms and do not need to care about authentication. By default the user agent will present the login dialog when required, requesting for credentials. The user agent will keep the credentials and use it when necessary automatically.
If you would like to use your own custom login dialog you can set the credentials using SetCredentials method of WebDavSession object provided by each IT Hit AJAX File Browser instance:
var ajaxFileBrowser = new ITHit.WebDAV.Client.AjaxFileBrowser.Controller('AjaxFileBrowserContainer', 'http://webdavserver.com/', 'height: 500px; width: 500px'); ajaxFileBrowser.GetSession().SetCredentials('User1', 'pwd'); ajaxFileBrowser.SetSelectedFolder('/');
If you set the credentials via SetCredentials method the default browser login dialog will not popup.
In some users agents, such as Google Chrome and Safari, you may experience a long delay before you will see the AJAX File Browser progress bar starts refreshing when your WebDAV server requires authentication. This delay is caused by preauthentication mechanisms used by user agent. If preauthentication occurs the user agent will first submit entire file to server without authentication information and will get the 401 Unauthorized response. Only after that the user agent will submit the file content with authentication information and the AJAX File Browser will start refreshing progress bar.
Note that Internet Explorer on Windows Vista requires SSL connection when using Basic authentication. IE on Vista will not pop any dialog or warning if insecure connection is used with basic authentication.
Apple Safari never pops the authentication dialog. To provide authentication information you must develop your own authentication dialog and set credentials via SetCredentials method.
|