[Security] - Basic Authentication and unicode credentials
by aleksandarradulovic
Couple of weeks ago, while working on my current project, I configured my application, deployed on JBOSSAS 4.2.3, to use DatabaseServerLoginModule for the purpose of authenticating WebService clients using BasicAuthentication and it went fine.
However, problem occurred when I was requested to enable users to login using Cyrillic letters.
I found no better solution but to make my custom login module, extended from DatabaseServerLoginModule, that does simple string conversion in order to have things done.
Follows the code:
public class DBLoginModule extends DatabaseServerLoginModule{
| public static final String isoEncoding = "ISO-8859-1";
| public static final String utfEncoding = "utf-8";
|
| protected String getUsername() {
| String username = super.getUsername();
|
| try {
| username = transform(username);
| } catch (UnsupportedEncodingException e) {
| e.printStackTrace();
| }
|
| return username;
| }
|
| protected boolean validatePassword(String inputPassword, String expectedPassword) {
| try {
| inputPassword = transform(inputPassword);
| } catch (UnsupportedEncodingException e) {
| e.printStackTrace();
| }
|
| return super.validatePassword(inputPassword, expectedPassword);
| }
|
| public static String transform(String string) throws UnsupportedEncodingException {
| return new String(string.getBytes(isoEncoding),utfEncoding);
| }
| }
Still, I wonder if this is the only solution I was able to apply... And if is, it seems to me quite cumbersome to do things like this - that support should be built in into the server...
And it took me a lot of time to realize what was going on behind the scene, and documentation, including existing posts regarding this or similar problems were quite difficult for me to understand and realize what the problem was.
I would really like to hear your opinion about this and I am looking forward to it!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252911#4252911
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252911
15 years, 4 months
[Clustering] - Re: IP binding, Multicast, and Mod_jk loadbalancing
by wrexcil
Yes, I have done that, I have my tomcat-service.xml file in the deploy directory with the entry:
I've commented out all AJP connector information in server.xml (/usr/local/jboss/tomcat-4.1.x/conf/) as the config is in the jboss deploy directory.
Like I said when I fire up jboss/tomcat the AJP connection does start listening on 7102, and apache also connects to it: see mod_jk log:
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] wc_get_worker_for_name::jk_worker.c (111): found a worker ajp13_q01-rpt-report01
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] wc_maintain::jk_worker.c (301): Maintaining worker ajp13_q01-rpt-report01
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] init_ws_service::mod_jk.c (517): Service protocol=HTTP/1.1 method=GET host=(null) ad
drr=10.168.156.159 name=q01-rpt-report01.stage.root port=80 auth=(null) user=(null) laddr=10.63.81.165 raddr=10.168.156.159
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] ajp_get_endpoint::jk_ajp_common.c (2131): acquired connection cache slot=0
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] ajp_marshal_into_msgb::jk_ajp_common.c (566): ajp marshaling done
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] ajp_service::jk_ajp_common.c (1670): processing with 3 retries
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] jk_open_socket::jk_connect.c (328): socket TCP_NODELAY set to On
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] jk_open_socket::jk_connect.c (426): trying to connect socket 15 to 127.0.0.1:8009
[Tue Sep 01 11:07:59 2009] [11456:42752] [info] jk_open_socket::jk_connect.c (444): connect to 127.0.0.1:8009 failed with errno=111
[Tue Sep 01 11:07:59 2009] [11456:42752] [info] ajp_connect_to_endpoint::jk_ajp_common.c (889): Failed opening socket to (127.0.0.1:
8009) with (errno=111)
As you can see it finds the worker I specified in my workers.properties file, but then for some reason tries to connect to 127.0.0.1:8009 (instead of 7102). None of my configs have localhost and 8009. Its not in workers.properties, httpd.conf, server.xml or tomcat-service.xml. I just have no idea where its picking it up...
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252909#4252909
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252909
15 years, 4 months
[Installation, Configuration & Deployment] - Re: JBoss server hangs in state
by PeterJ
Your are using XP, is the other PC also using XP? I ask because the netstat output appears to be coming out in a different order (the bound ports are in the third column instead of the second column, like on your PC).
It appears you ran netstat on your PC with 4.2.3 twice and got two different outputs?
If the telnet did not work then port 1099 is not bound to localhost. Try again using:
telnet roell 1099
If that works, then do these things.
First, when you start JBoss AS within Eclipse you should see the console log output in Eclipse's console window. A few lines before the "started in xxx seconds" line there will be a line that looks like this:
08:19:20,537 INFO [Http11Protocol] (main) Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
Post that line from your output.
Second, run JBoss AS from the command line. Then find the same line and post it also.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252876#4252876
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252876
15 years, 4 months
[Clustering] - Re: IP binding, Multicast, and Mod_jk loadbalancing
by wrexcil
I am also having the same problem. The only difference being I am also changing the port via workers.properties:
#define 1 worker using ajp13 for q01-rpt-report01
worker.list=ajp13_q01-rpt-report01
#set properties for worker ajp13
worker.ajp13_d01-rpt-report01.port=7102
worker.ajp13_d01-rpt-report01.host=10.63.81.165
worker.ajp13_d01-rpt-report01.type=ajp13
worker.ajp13_d01-rpt-report01.local_worker=1
After I start tomcat I can see it listening on 7102 (and not 8009), but it still attempts to connect to 127.0.0.1:8009. No where in my configs is 8009 enabled... but it still tries it! Any ideas?
mod_jk log:
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] jk_open_socket::jk_connect.c (328): socket TCP_NODELAY set to On
[Tue Sep 01 11:07:59 2009] [11456:42752] [debug] jk_open_socket::jk_connect.c (426): trying to connect socket 15 to 127.0.0.1:8009
[Tue Sep 01 11:07:59 2009] [11456:42752] [info] jk_open_socket::jk_connect.c (444): connect to 127.0.0.1:8009 failed with errno=111
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4252869#4252869
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4252869
15 years, 4 months