windows 下配置浏览器使用 kerberos
最近 hadoop 一系列软件都给加上了 kerberos 认证,整体来说还算顺利,各组件也都继续正常工作,唯独 storm ui,个天杀的在 windows 上打不开。
HTTP ERROR: 403
Problem accessing /index.html. Reason:
GSSException: Defective token detected (Mechanism level: GSSHeader did not find the right tag)
Powered by Jetty://
ok, 现在就需要实现能在 windows 上访问带有 kerberos 权限验证的 storm ui 了。
1. 找个 kerberos 在 windows 上的实现,能 kinit 啥的
我这里找到一个 MIT 的实现. 我下载的是 64-bit MSI Installer kfw-4.1-amd64.msi, 10812k.
安装完了它就自动的在 PATH 里面加上了自己的目录,但是!!! 我这里安装的 oracle jdk 里面也带了一些 kinit, ktab, klist 等软件,而且我这里 jdk 的顺序靠前,所以输入 kinit 、klist 的时候
执行的其实是 jdk 里面的工具,而我没有留心去找怎么配置 jdk 里面的,我的做法就是把 kfw 的 path 弄得靠前一点。
怎么通过 kinit 登录就不讲了吧。。

2. 配置浏览器
参考 http://storm.apache.org/releases/1.1.1/SECURITY.html#ui-logviewer,打开 firefox 浏览器 (为啥不是 chrome 及 ie 后面会讲), 输入 about:config 修改配置项 network.negotiate-auth.trusted-uris double-click 如图

3. 验证
配置完成后验证一下还是要有的,使用 firefox 打开 storm ui 的地址试一下吧。

4. chrome 及 IE 目前未能测试通过。先将细节展示出来
4.1. firefox 执行流程
4.1.1 firefox 像对待普通网站一样去访问 storm ui 结果服务器拒绝了它并返回了 401 需要授权

4.1.2 firefox 懵了一下并携带密钥再去访问了一次 storm ui,这次 storm ui 接受了它并告诉它 cookie 是什么以及一个验证的密钥

4.1.3 firefox 觉得 storm ui 的密钥是对的并非常信任他,以后访问的时候就带着 cookie 去请求了。

4.2 Chrome 为什么不行呢?
4.2.1 chrome 觉得自己知道 storm ui 需要 kerberos 授权,所以主动带着不知道哪里来的 很短的 密钥 去访问 storm ui,storm 果断拒绝了 chrome 的请求并返回 403.

4.2.2 over
4.3 IE 比 Chrome 好一点点,但是也是一个悲剧
4.3.1 IE 并不知道 storm ui 需要 kerberos 授权,直接就去访问了,服务器无情的拒绝它并向它扔了一个 401 状态码。

4.3.2 IE 意识到需要表明自己的身份然后拿了一个非常短的密钥串再次请求服务器并遭到拒绝,这次服务器返回了一个 403 。(chrome: 呵呵)

4.3.3 全剧终
更新:
为什么 chrome 和 IE 的 Auth 串这么短呢?
stackoverflow 上相关讨论 https://stackoverflow.com/questions/5597573/how-to-find-if-ntlm-or-kerberos-is-used-from-www-authenticate-negotiate-header 里面说了, 这里贴一下精简版:
If the Authorization token begins with "YII" then Kerberos is used, but if it begins with "TlR" then Kerberos is not used. For example Kerberos: Authorization: Negotiate YIIVDAYGKwYBE...
Not Kerberos: Authorization: Negotiate TlRMTVNTUA...
所以说 chrome 和 IE 的那个串生成方式不对。。
2017/08/29 更新:
https://www.chromium.org/developers/design-documents/http-authentication 上如是说:
Negotiate external libraries
On Windows, Negotiate is implemented using the SSPI libraries and depends on code in secur32.dll.
On Android, Negotiate is implemented using an external Authentication app provided by third parties. Details are given in Writing a SPNEGO Authenticator for Chrome on Android. The AuthAndroidNegotiateAccountType policy is used to tell Chrome the Android account type provided by the app, hence letting it find the app.
On other platforms, Negotiate is implemented using the system GSSAPI libraries. The first time a Negotiate challenge is seen, Chrome tries to dlopen one of several possible shared libraries. If it is unable to find an appropriate library, Chrome remembers for the session and all Negotiate challenges are ignored for lower priority challenges.The GSSAPILibraryName policy can be used to specify the path to a GSSAPI library that Chrome should use.Otherwise, Chrome tries to dlopen/dlsym each of the following fixed names in the order specified:
- OSX: libgssapi_krb5.dylib
- Linux: libgssapi_krb5.so.2, libgssapi.so.4, libgssapi.so.2, libgssapi.so.1
Chrome OS follows the Linux behavior, but does not have a system gssapi library, so all Negotiate challenges are ignored.
- Support NTLMv2 on Mac and Linux. Our portable NTLM code supports NTLMv1 only.
- Support GSSAPI on Windows [for MIT Kerberos for Windows or Heimdal]
- Warn about Basic authentication scheme over unencrypted channels.
参考:
1. storm ui doc http://storm.apache.org/releases/1.1.1/SECURITY.html#ui-logviewer
2. mit kerberos http://web.mit.edu/kerberos/dist/index.html
windows 下配置浏览器使用 kerberos的更多相关文章
- windows下配置lamp环境(2)---配置Apache服务器2.2.25
配置Apache 配置Apache时,先要找到安装目录中的主配置文httpd.conf,使用文本编辑器打开,最好不要使用windows自带的编辑器,可以使用NotePad++, vim,或者subli ...
- 一台Windows下配置多个Tomcat服务器
上一篇博客<Windows下配置Tomcat服务器>讲了,如何在一台Windows机器上配置一个Tomcat服务器.这篇介绍一下如何在一台Windows机器上配置多个Tomcat. 第一步 ...
- windows 下配置 Nginx 常见问题(转)
windows 下配置 Nginx 常见问题 因为最近的项目需要用到负载均衡,不用考虑,当然用大名鼎鼎的Nginx啦.至于Nginx的介绍,这里就不多说了,直接进入主题如何在Windows下配置. 我 ...
- Windows下配置使用 MemCached
Windows下配置使用MemCached 工具: memcached-1.2.6-win32-bin.zip MemCached服务端程序(for win) Memcached Manage ...
- windows下配置wnmp
最近尝试windows下配置nginx+php+mysql,在这里总结一下. 1.下载windows版本的nginx,官网下载地址:http://nginx.org/en/download.htm, ...
- windows下配置lamp环境(5)---配置MySQL5.6
开始配置mysql 1.创建配置文件my.ini 1.进入C:\wamp\MySQL 2.把my-default.ini 另存一份:my.ini 3.开始编辑mysql的配置文件,打开my ...
- windows下配置lamp环境(3)---配置PHP5.4
下面配置php Php文件夹里有两个php.ini-*文件,随便修改一个,去掉后缀,变成php.ini (如图) 打开php.ini ,添加php扩展目录723行左右(其实放哪都无所谓,只不过php. ...
- windows下配置lamp环境(0)---软件获取
工作快一年了,还没有怎么配置过服务器环境,经常使用集成套件wampserver,为了复习配置wamp服务器 特意在虚拟机中测试安装步骤如下. 安装前步骤:下载软件.软件下载地址如下: 1.apache ...
- windows下配置svn的https访问
svn是一个功能强大的代码版本管理系统,可以将服务端安装在linux.unix以及windows下.svn通常采用http方式进行代码提交与下载.由于密码采用明文传输,因此存在泄密的风险.若采用htt ...
随机推荐
- [洛谷P3693]琪露诺的冰雪小屋
题目大意:琪露诺的冰雪小屋,我做的第一道大模拟题. 题解:模拟... 卡点:无数小错误,要是没有写一点调一点,那大概是永远调不出来了... C++ Code: #include <cstdio& ...
- oracle设置自动清理归档日志脚本
设置定时自动清理归档日志脚本 root用户下 [root@localhost ~]# mkdir /nstg [root@localhost ~]# cd /nstg/ [root@localhost ...
- 注意@Bean中的initMethod和destroyMethod
@Configuration public class AppConfig { @Bean(initMethod = "init") public Foo foo() { retu ...
- jquery的ajax实现方式
在JQuery中,AJAX有三种实现方式:$.ajax() , $.post , $.get(). 首先我们看$.get(): .代码如下: $.get("test.jsp", { ...
- 7月23号day15总结
数据清洗完成之后开始编写前端,通过spring框架将清洗后数据库中的数据显示在页面中. 框架的搭建和js的使用都在学习阶段,
- 自建git服务器搭建使用记录
git在push的时候出现insufficient permission for adding an object错误 //解决方法,在git库的目录下 //明明一开始创建user的时候有执行这个命令 ...
- word使用宏 在文章中插入源代码进行排版
1.宏的代码如下. Sub 设置代码表格() ' author: code4101 ' 设置代码表格 宏 ' ' ' 背景色为morning的配色方案,RGB为(229,229,229) ) With ...
- ORACLE中根据生日得到年龄
create or replace function F_GETAGE(dateofbirth date) return varchar2 is begin ) then ); else ) then ...
- Codeforces Round #301 解题报告
感觉这次的题目顺序很不合理啊... A. Combination Lock Scrooge McDuck keeps his most treasured savings in a home sa ...
- 填坑webpack
1.Concepts: webpack is a module bundler for modern JS applications. Since there are lots of complex ...