[jboss-jira] [JBoss JIRA] (JBNAME-58) JBoss ignoring SECURITY_PRINCIPALand SECURITY_CREDENTIALS when using org.jboss.naming.HttpNamingContextFactory. Its lead to "Server redirect too many times(20).

Sasi Levi (JIRA) jira-events at lists.jboss.org
Wed Mar 14 06:32:47 EDT 2012


Sasi Levi created JBNAME-58:
-------------------------------

             Summary: JBoss ignoring SECURITY_PRINCIPALand SECURITY_CREDENTIALS when using org.jboss.naming.HttpNamingContextFactory. Its lead to "Server redirect too many times(20).
                 Key: JBNAME-58
                 URL: https://issues.jboss.org/browse/JBNAME-58
             Project: JBoss Naming
          Issue Type: Bug
          Components: jnp-client, jnpserver, naming
         Environment: JBoss 4.2.3GA linux
            Reporter: Sasi Levi


I tried to use the following configuration.
hm.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.HttpNamingContextFactory");
hm.put(Context.PROVIDER_URL, "https://<host>:443/invoker/JNDIFactory");
hm.put(Context.SECURITY_PRINCIPAL, "<user>");
hm.put(Context.SECURITY_CREDENTIALS, "<password>");
InitialContext ic = new InitialContext(hm);

I'm getting in the client side:


TRACE] Retrieving content from : https://<host_name>:443/invoker/JNDIFactory
[DEBUG] Using ThreadLocal: false
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] getPrincipal, principal=null
[TRACE] ContentLength: 948
ContentType: text/html;charset=utf-8
Exception in thread "main" javax.naming.NamingException: Failed to retrieve Naming interface for provider https://<host_name>:443/invoker/JNDIFactory [Root exception is java.net.ProtocolException: Server redirected too many  times (20)]
	at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:84)
	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
	at javax.naming.InitialContext.init(InitialContext.java:223)
	at javax.naming.InitialContext.<init>(InitialContext.java:197)
	at client.TestJndiWithHttpsWithLoginModule.main(TestJndiWithHttpsWithLoginModule.java:45)
Caused by: java.net.ProtocolException: Server redirected too many  times (20)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
	at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1368)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1362)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1016)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
	at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextFactory.java:133)
	at org.jboss.naming.HttpNamingContextFactory.getInitialContext(HttpNamingContextFactory.java:80)
	... 5 more
Caused by: java.net.ProtocolException: Server redirected too many  times (20)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1323)
	at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2173)
	at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:579)
	at java.net.URLConnection.getContentLength(URLConnection.java:474)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:378)
	at org.jboss.naming.HttpNamingContextFactory.getNamingServer(HttpNamingContextFactory.java:128)
	... 6 more



I used only custom LoginModule and I saw NULL/NULL as username password.

I don't want to use the LoginJndi...

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list