创建服务主体在2K8服务器springsecurity的Kerberos [英] creating service principal for springsecurity kerberos in 2k8 server

查看:208
本文介绍了创建服务主体在2K8服务器springsecurity的Kerberos的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下面这篇文章 HTTP://blog.springsource .COM / 2009/09/28 /弹簧安全的Kerberos / 成立,我将使用测试与Active Directory春季安全集成在本地服务器上的服务主体。服务器已经运行的tomcat我在哪里部署应用程序,我通过访问的http://本地主机:8080 / MyApp的

I'm following this post http://blog.springsource.com/2009/09/28/spring-security-kerberos/ to set up a service principal on a local server which i'll be using to test the spring security integration with active directory. The server has tomcat running where i deploy my application and I access it by http://localhost:8080/myapp

问题

应该是什么我的服务提供者的名称?

What should be my service provider name?

文章说:

对于这项工作,每一个Web应用程序需要在登记   Kerberos服务器并得到PRINICIPAL服务和共享的秘密   分配。对于Web应用程序,服务主体必须是   HTTP / @域。例如   HTTP/web.springsource.com@SPRINGSOURCE.COM,如果你的应用程序运行在   web.springsource.com。

For this to work, every web applications needs to be registered at the Kerberos server and gets a service prinicipal and a shared secret assigned. For web applications, the service principal must be "HTTP/@DOMAIN". For example "HTTP/web.springsource.com@SPRINGSOURCE.COM", if your app runs on web.springsource.com.

由于我在本地主机运行我想这将是 HTTP /本地主机@ .... 什么做我把 @ SPRINGSOURCE.COM?

Since I'm running on localhost I guess it will be HTTP/localhost@.... what do I put inplace of @SPRINGSOURCE.COM?

推荐答案

要Kerberos的工作,你应该在网络中配置DNS和AD服务器。应用服务器和客户机必须使用DNS和客户机必须使用AD身份验证。使用的名称为本地主机是不允许的。应用服务器可能无法在该域

To Kerberos working, you should configure DNS and AD server in your network. Application server and the client machine must use the DNS and client machines must use AD authentication. Use the name "localhost" is NOT permissible. The application server may not be in the domain.

假设所有机器在您需要的域名,然后是:

Suppose all machines in the domain then you need is:

  1. 在指定的应用程序服务器的DNS名称,例如应用程序服务器(应用程序服务器 .yourdomain.local)
  2. 添加DNS名称的直接的区域服务器应用程序和反向DNS服务器。 (链接
  3. 创建域中的一个简单的用户并设置选项不能更改密码和密码永不过期是有限的(如用户名 MYUSER
  4. 在服务器,域控制器,打开命令提示符,运行以下命令:

  1. Assign an application server dns name eg appserver (appserver.yourdomain.local)
  2. Add the DNS name of your server applications in the area of ​​direct and reverse DNS-server. (link)
  3. Create a simple user in the domain and set the option "not change password" and "Password never expires is limited" (eg username myUser)
  4. On the server, the domain controller, open a command prompt and run the following commands:

C:> SETSPN -A HTTP /应用服务器MYUSER

C:>setspn -A HTTP/appserver myUser

C:> SETSPN -A HTTP / appserver.yourdomain.local MYUSER

C:>setspn -A HTTP/appserver.yourdomain.local myUser

检查正确的:

C:> SETSPN -l MYUSER(如果将显示你pviously输入$ P $,那么一切都OK 的)

C:>setspn -l myUser (if will display what you entered previously, then everything is OK)

接下来,创建一个密钥文件:

Next, create a key file:

C:>的ktpass /输出C:/myUser.keytab / mapuser myUser@YOURDOMAIN.LOCAL / PRINC HTTP/appserver.yourdomain.local@YOURDOMAIN.LOCAL /通+ rndPass /密码RC4-HMAC-NT / p型KRB5_NT_PRINCIPAL / KVNO 0

C:>ktpass /out C:/myUser.keytab /mapuser myUser@YOURDOMAIN.LOCAL /princ HTTP/appserver.yourdomain.local@YOURDOMAIN.LOCAL /pass +rndPass /crypto RC4-HMAC-NT /ptype KRB5_NT_PRINCIPAL /kvno 0

就是这样,现在你可以使用文件的 myUser.keytab 和主体名称的 HTTP / appserver.yourdomain.local 在你的web应用程序

That's it, now you can use the file myUser.keytab and principal name HTTP/appserver.yourdomain.local in your web application

可能在未来有用的:

  • <一个href="http://stackoverflow.com/questions/13583682/blank-page-after-user-cancels-basic-authentication/26350395#26350395">Blank用户页面后取消基本身份验证
  • <一个href="http://stackoverflow.com/questions/21093480/combine-custom-authentication-filter-with-spring-security-kerberos/26350288#26350288">Combine自定义验证过滤器,弹簧安全的Kerberos
  • Blank page after user cancels basic authentication
  • Combine custom authentication filter with spring-security-kerberos

这篇关于创建服务主体在2K8服务器springsecurity的Kerberos的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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