ithit阿贾克斯文件浏览器的活动目录的WebDav自动登录 [英] ithit-ajax-file-browser active directory WebDav auto-login

查看:187
本文介绍了ithit阿贾克斯文件浏览器的活动目录的WebDav自动登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Windows Server2012 R2和IIS 8.5 Active Directory中创建WebDAV为每个用户,它可以通过用户名和用户密码进行访问。 每个用户一个文件夹。 这工作完全使用WebDAV客户端。 我也有使用ithit Ajax的文件浏览器Web浏览器。

I'm using Active Directory in Windows Server2012 R2 and IIS 8.5 to create a WebDav for each user and it can be accessed via the user-name and user-password. One folder per user. This works perfectly using WebDav clients. I have also a web browser using ithit-ajax-file-browser.

我的问题是,当我设置参数Web的部分服务器显示了一个鉴别弹出自动登录我面前。

My problem is, when i set parameters to the web-part the server shows up an authentification pop-up before logging me automatically.

I'im使用

    var settings = {
                    BasePath: '/davbrowser/',                      
                    Id: 'AjaxFileBrowserContainer',     
                    Url: webDavServerPath,              
                    Style: 'height: 100%; width: 100%', 
                    MsOfficeTemplatesPath: '/templates/', 
                    SelectedFolder: webDavServerPath,   
                    ThemeName: 'windows_8',             
                    IconsSize: 16                       
                    //Platform: 'mobile'                
                };
var ajaxFileBrowser = new ITHit.WebDAV.Client.AjaxFileBrowser.Controller(settings);
ajaxFileBrowser.GetSession().SetCredentials('username', 'password');
ajaxFileBrowser.SetSelectedFolder('/username');

`

自动登录的作品,但在登录弹出仍然出现。 是否有任何解决方案,将其删除? 我使用的是基本认证方式

The auto-login works but the login pop-up still appears. Are there any solution to delete it? I'm using basic authentification

推荐答案

在你的code,在设置中,您正在设置SelectedFolder参数。这会导致被称为SetCredentials方法之前要发送的请求。取出SelectedFolder设置,并呼吁只有SetSelectedFolder,这是做同样的事情,但SetCredentials方法调用后。

In your code, in settings, you are setting the SelectedFolder parameter. This causes the request to be sent before the SetCredentials is called. Remove the SelectedFolder setting and call only SetSelectedFolder, which is doing the same thing, but after the SetCredentials call.

我也建议更新您的code使用异步的方式,在它推出打阿贾克斯文件浏览器v2.1.0.1483:

I would also suggest to update your code to use the async approach, introduced in IT Hit Ajax File Browser v2.1.0.1483:

var settings = {
                BasePath: '/davbrowser/',                      
                Id: 'AjaxFileBrowserContainer',     
                Url: webDavServerPath,              
                Style: 'height: 100%; width: 100%', 
                MsOfficeTemplatesPath: '/templates/', 
                //SelectedFolder: webDavServerPath,   
                ThemeName: 'windows_8',             
                IconsSize: 16                       
                //Platform: 'mobile'                
            };


    var ajaxFileBrowserLoader = new ITHit.WebDAV.Client.AjaxFileBrowserLoader(settings);
    ajaxFileBrowserLoader.oninit = function(ajaxFileBrowser) {
        // This event is fired when control is loaded and created.
        ajaxFileBrowser.GetSession().SetCredentials('username', 'password');
        ajaxFileBrowser.SetSelectedFolder('/username'); 
    };
    ajaxFileBrowserLoader.LoadAsync();

另一件事,那可能会导致标准的Web浏览器登录对话框是CORS请求。也就是说如果您的settings.Url参数包含位于另一个原点(域,端口或协议)WebDAV服务器的URL。不幸的是没有这种情况下,任何真正的解决方案。唯一的解决方法是将使用Ajax文件浏览器的页面在同一台服务器,其中WebDAV服务器位于。你可以找到更多关于它这里

这篇关于ithit阿贾克斯文件浏览器的活动目录的WebDav自动登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆