2012-08-15 2 views
6

Ich habe meinen JBoss AS 7-Server schließlich so konfiguriert, dass er in einer AD-Domäne gegen Windows 2008 R2 verwendet. Ich verwende Java 7.Wie kann ich auf die BASIC- oder FORM-Authentifizierung zurückgreifen, wenn SPNEGO nicht für einen Client verwendet werden kann?

Wenn ein Benutzer auf die Server-URL von einem anderen Ort als einem Domänencomputer (z. B. von einem Mobiltelefon oder dem breiteren Internet) zugreift, werden sie aufgefordert, einen Benutzernamen und ein Passwort einzugeben der Fehler:

Login failure: javax.security.auth.login.LoginException: Unsupported negotiation mechanism 'NTLM' 

Wenn der Benutzer auf die URL zugreifen, wenn in der Domäne angemeldet ist, ist alles in Ordnung.

Auf der SPNEGO sicherheits Domain (standalone.xml) konfiguriert I 2 Login-Module:

Erstens: org.jboss.security.negotiation.spnego.SPNEGOLoginModule

Zweitens:

<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required"> 
    <module-option name="password-stacking" value="useFirstPass"/> 
    <module-option name="usersProperties" value="file:${jboss.server.config.dir}/spnego-users.properties"/> 
    <module-option name="rolesProperties" value="file:${jboss.server.config.dir}/spnego-roles.properties"/> 
    <module-option name="defaultUsersProperties" value="file:${jboss.server.config.dir}/spnego-users.properties"/> 
    <module-option name="defaultRolesProperties" value="file:${jboss.server.config.dir}/spnego-roles.properties"/> 
</login-module> 

Die Frage ist: Wie kann ich auf BASIC Rückfall oder wenn außerhalb des Geltungsbereichs ist?

Dank

Volle Ausnahme folgt:

00:40:23,751 ERROR [org.jboss.security.authentication.JBossCachedAuthenticationManager] (http--0.0.0.0-9090-8) Login failure: javax.security.auth.login.LoginException: Unsupported negotiation mechanism 'NTLM'. 
     at org.jboss.security.negotiation.spnego.SPNEGOLoginModule.spnegoLogin(SPNEGOLoginModule.java:230) [jboss-negotiation-spnego-2.2.0.SP1.jar:2.2.0.SP1] 
     at org.jboss.security.negotiation.spnego.SPNEGOLoginModule.innerLogin(SPNEGOLoginModule.java:194) [jboss-negotiation-spnego-2.2.0.SP1.jar:2.2.0.SP1] 
     at org.jboss.security.negotiation.spnego.SPNEGOLoginModule.login(SPNEGOLoginModule.java:137) [jboss-negotiation-spnego-2.2.0.SP1.jar:2.2.0.SP1] 
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_05] 
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_05] 
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_05] 
     at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_05] 
     at javax.security.auth.login.LoginContext.invoke(LoginContext.java:784) [rt.jar:1.7.0_05] 
     at javax.security.auth.login.LoginContext.access$000(LoginContext.java:203) [rt.jar:1.7.0_05] 
     at javax.security.auth.login.LoginContext$4.run(LoginContext.java:698) [rt.jar:1.7.0_05] 
     at javax.security.auth.login.LoginContext$4.run(LoginContext.java:696) [rt.jar:1.7.0_05] 
     at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_05] 
     at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:695) [rt.jar:1.7.0_05] 
     at javax.security.auth.login.LoginContext.login(LoginContext.java:594) [rt.jar:1.7.0_05] 
     at org.jboss.security.authentication.JBossCachedAuthenticationManager.defaultLogin(JBossCachedAuthenticationManager.java:449) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final] 
     at org.jboss.security.authentication.JBossCachedAuthenticationManager.proceedWithJaasLogin(JBossCachedAuthenticationManager.java:383) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final] 
     at org.jboss.security.authentication.JBossCachedAuthenticationManager.authenticate(JBossCachedAuthenticationManager.java:371) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final] 
     at org.jboss.security.authentication.JBossCachedAuthenticationManager.isValid(JBossCachedAuthenticationManager.java:160) [picketbox-infinispan-4.0.7.Final.jar:4.0.7.Final] 
     at org.jboss.as.web.security.JBossWebRealm.authenticate(JBossWebRealm.java:214) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
     at org.jboss.security.negotiation.NegotiationAuthenticator.authenticate(NegotiationAuthenticator.java:187) [jboss-negotiation-common-2.2.0.SP1.jar:2.2.0.SP1] 
     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:455) [jbossweb-7.0.13.Final.jar:] 
     at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:] 
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:] 
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:] 
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:] 
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:] 
     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:] 
     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:] 
     at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_05] 

Antwort

1

Ehrlich gesagt, würde ich Ihnen vorschlagen, die Spring Security mit SPNEGO Erweiterung. Bitte sehen Sie etwas wie: http://blog.springsource.org/2009/09/28/spring-security-kerberos/

Danach können Sie mehrere Authentifizierung Anbieter haben.

Citation entnommen aus: Multiple Authentication Providers in Spring Security

Sie können so viele Anbieter angeben, wie Sie wollen. Sie werden in der gleichen Reihenfolge überprüft, in der Sie sie im Authentifizierungs-Manager-Tag deklariert haben. Sobald eine erfolgreiche Authentifizierung durchgeführt wurde, wird die Abfrage der Anbieter gestoppt. Wenn ein Anbieter eine AccountStatusException auslöst, wird die Abfrage ebenfalls unterbrochen.

Auf diese Weise sind Sie nicht von einer bestimmten Anwendungsserverkonfiguration abhängig.

0

Sie müssen WEB-INF/web.xml-Datei Grund zu Rückfall ändern:

<context-param> 
    <description>BASIC Authentication FallBack</description> 
    <param-name>org.jboss.security.negotiation.NegotiationAuthenticator.BasicAuthFallBack</param-name> 
    <param-value>true</param-value> 
</context-param> 

Sehen Sie hier für weitere Details:

https://issues.jboss.org/browse/SECURITY-793

Verwandte Themen