-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
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...