Hi,
I would like to get a IP of the user and log it into my DB a an audit record,
I found several threads that state how to get IP from SocketChannel but how do I get a SocketChannel reference?
I need this info inside login event handler method, so I have event parameter, but API docs does not state any method that gives me SocketChannel from event object,
event.getParameter("chan"); there must be something like this right?
second question: Is there any way to get an IP if user is connected through blueBox?
I read in this thread : viewtopic.php?t=2766&highlight=getinetaddress
that bluebox returns always localhost IP, but it islittle bit old thread so maybe there has be addition to bluebox to retreive user IP?
this is quite important for me since I must log every single attempt on login with proper IP address.
[bluebox] getting user IP upon user login in Java ext
[bluebox] getting user IP upon user login in Java ext
Last edited by levancho on 14 Sep 2011, 14:43, edited 1 time in total.
Hi
You can try this inside you login handler:
Not sure if it will work with the bluebox though.
You can try this inside you login handler:
Code: Select all
ISession session = ( Session ) event.getParameter( SFSEventParam.SESSION );
//trace the ip
trace( session.getAddress() );
//trace ip:port
trace( session.getFullIpAddress() );
Not sure if it will work with the bluebox though.
Who is online
Users browsing this forum: Thomasea and 56 guests