微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用httpclient \ kerberos以编程方式设置用户名,而不是提示

我有一个linux java6客户端,它将通过KERBEROS向sharepoint2010进行身份validation,然后使用Apache Commons HttpClient 4.2发送HTTP REST Web服务

如果我在连接我的客户端运行之前,从命令行"kinit myuser@mydomain"运行平滑。

我的问题是,如果我不运行kinit,我得到一个用户名提示

如何在不提示用户名的情况下以编程方式进行身份validation,而无需运行命令行程序?

Windows应用程序authentication套件失败:多用户会话testing

Java中的Linux PAM模块

ASP.NET / IIS安全性(Windows身份validation)

使用python 3在linux中validation用户

ASP.NET,401 – 未经授权,有效的帐户

(我创build和keytab,并在login.conf中定义它,以便照顾密码提示,而不是用户promt)

public static void main(String[] args) throws Exception { System.setProperty("java.security.auth.login.config","login.conf"); System.setProperty("java.security.krb5.conf","krb5.conf"); System.setProperty("sun.security.krb5.debug","true"); System.setProperty("javax.security.auth.useSubjectCredsOnly","false"); DefaultHttpClient httpclient = new DefaultHttpClient(); try { httpclient.getAuthSchemes().register(AuthPolicy.SPNEGO,new SPNegoSchemeFactory()); Credentials use_jaas_creds = new Credentials() { public String getpassword() { return null; } public Principal getUserPrincipal() { return null; } }; httpclient.getCredentialsProvider().setCredentials( new AuthScope(null,-1,null),use_jaas_creds); HttpUriRequest request = new HttpGet("http://kerberoshost/"); HttpResponse response = httpclient.execute(request); httpentity entity = response.getEntity(); System.out.println("----------------------------------------"); System.out.println(response.getStatusLine()); System.out.println("----------------------------------------"); if (entity != null) { System.out.println(EntityUtils.toString(entity)); } System.out.println("----------------------------------------"); // This ensures the connection gets released back to the manager EntityUtils.consume(entity); } finally { // When HttpClient instance is no longer needed,// shut down the connection manager to ensure // immediate deallocation of all system resources httpclient.getConnectionManager().shutdown(); } }

如何在安装sqlEXPR_x64_ENU时通过cmd启用sql身份validation模式?

Nginx auth_request:访问原始查询参数

除了那些允许的Apache基本authentication

login不支持Django + Nginx + uwsgi

Nginx auth_basic“Restricted”提示每次请求login

除了keytab文件之外,您还必须提供主体名称以获得完全透明的客户机Kerberos身份验证(kinit):

client { com.sun.security.auth.module.Krb5Loginmodulee required useKeyTab=true storeKey=true keyTab=/path/to/userKeytab principal="userName"; };

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐