Get IP of server where request came from

Here's the scenario:
User is browsing website A, hosted in server A.
He clicks on a link that opens website B, hosted in server B.
Server B should "skip" authentication only if the request came from server A.
My question is, from the code in website B, how do I retrieve the IP or hostname where the request came from? Basically I need to find out if the request came from server A (not some other server).
Any help will be appreciated. Thank you.

If you want to use programmatic security, then this might work in servlet/jsp:
//i think this returns the full url.
String refText = request.getHeader("referer");
String ip = null;
if(refText != null){
     java.net.URL url = new java.net.URL(refText);
     String host = url.getHostname();
     ip = java.net.InetAddress.getByName(host).toString();
}

Similar Messages

  • Hi, I cannot restart or shut down my MAC and get the message Geneio.it installer is cancelling your request. Please shut down and retry. However, I cannot seem to exit that application and I have no idea where it came from. Thanks

    Hi, I cannot restart or shut down my MAC and get the message Geneio.it installer is cancelling your request. Please shut down and retry. However, I cannot seem to exit that application and I have no idea where it came from. Thanks
    Could this be a virus?

    Hold down the Power button until the computer shuts down.
    The Safe Mac » Adware Removal Guide - Genieo
    The Safe Mac » Adware Removal Guide
    Helpful Links Regarding Malware Protection
    An excellent link to read is Tom Reed's Mac Malware Guide.
    Also, visit The XLab FAQs and read Detecting and avoiding malware and spyware.
    See these Apple articles:
              Mac OS X Snow Leopard and malware detection
              OS X Lion- Protect your Mac from malware
              OS X Mountain Lion- Protect your Mac from malware
              About file quarantine in OS X
    If you require anti-virus protection Thomas Reed recommends using Dr.Web Light from the App Store. It's free, and since it's from the App Store, it won't destabilize the system. If you prefer one of the better known commercial products, then Thomas recommends using Sophos.(Thank you to Thomas Reed for these recommendations.) If you already use Sophos, then be aware of this if you are using Mavericks: OS X Mavericks- Sophos Anti-Virus on-access scanner versions 8.0 - 9.1 may cause unexpected restarts
    From user Joe Bailey comes this equally useful advice:
    The facts are:
    1. There is no anti-malware software that can detect 100% of the malware out there.
    2. There is no anti-malware that can detect anything targeting the Mac because there
         is no Mac malware in the wild, and therefore, no "signatures" to detect.
    3. The very best way to prevent the most attacks is for you as the user to be aware that
         the most successful malware attacks rely on very sophisticated social engineering
         techniques preying on human avarice, ****, and fear.
    4. Internet popups saying the FBI, NSA, Microsoft, your ISP has detected malware on
        your computer is intended to entice you to install their malware thinking it is a
        protection against malware.
    5. Some of the anti-malware products on the market are worse than the malware
        from which they purport to protect you.
    6. Be cautious where you go on the internet.
    7. Only download anything from sites you know are safe.
    8. Avoid links you receive in email, always be suspicious even if you get something
        you think is from a friend, but you were not expecting.
    9. If there is any question in your mind, then assume it is malware.

  • I was in a conversation with a colleague and a text (identical) came to both of our phones, when he researched it, it said it was blocked and I thought I might see where it came from through my phone. Is it possible to get a spam like that to our phones

    I was in a conversation with a colleague and a text (identical) came to both of our phones, when he researched it, it said it was blocked and I thought I might see where it came from through my phone. Is it possible to get a spam like that to our phones at the same time.If the text came to my number marked from him, it could only have been from him?. Is there a possibility that someone else sent it to both of us at the same time?

    Yes, it could be spam. I get spam text from time to time. Yes, you both could have gotten the same spam at the same time. Spammers re sending out thousands and thousands of messages.

  • I have a symbol that has appeared on my iphone 4s top right just left off the bluetooth sign, it's an arrow on a circle with a padlock in the middle any idea where it came from and what it is

    i have a symbol that has appeared on my iphone 4s top right just left off the bluetooth sign, it's an arrow on a circle with a padlock in the middle any idea where it came from and what it is

    That's the portrait orientation lock (keeps the screen from rotating to landscape mode).  To turn it off, double-tap the home button, swipe the list at the bottom to the right, then tap the left-most icon (to the left of the music controls).

  • I have a new plugin showing up: z 4.6.7.5 Does anyone know exactly where it came from and what it is used for?

    I disabled plugin "z 4.6.7.5" because I have no idea where it came from. I have noticed no ill effects, so far.

    I don't know how it got there, but dwarvenhut is correct—it's an extension that doesn't seem to do anything, and it uses a non-existent component (components/f8bd48d8.dll in my case).
    To delete it from the extensions list, delete the folder in the Program Files\Mozilla Firefox\extensions directory; mine was called "{39fdc2ab-b323-a8a8-a497-763ced813cae}".

  • My trash bin has one item that refuses to be deleted. Under name, it says, 0. date; dec. 31, 1903. size; 0 kb. I have no idea where it came from. When I click, info. the info. window starts to appear, then goes away. Weird or what? Hope someone can help?

    my trash bin has one item that refuses to be deleted. Under name, it says, 0. date; dec. 31, 1903. size; 0 kb. I have no idea where it came from. When I click, info. the info. window starts to appear, then goes away. Weird or what? Hope someone can help?

    sorry i forgot that... i use php5 so i guessed at the module name... upon looking closer at the conf its mod_php4.c
    <pre>
    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    </IfModule>
    </pre>

  • Part fell off printer...don't know where it came from

    I have an Officeject 7500A Wide Format printer. All of a sudden there was a part laying on my desk and I don't know where it came from. It has this number on the back:
    >P0M<
    C10
    Any ideas where this piece belongs?

    Hi @pahenderson 
    Could you maybe take a photo of the part and post it here?
    Thanks
    Ciara
    Although I am an HP employee, I am speaking for myself and not for HP.
    Twitter: @Ciara_B_HP

  • I have a picture on my iPad that I don't know where it came from and I don't know how it got there. How can I find out.

    I have a picture on my iPad that I don't know where it came from don't know who it is and don't know how it got  there. How  do I find out how it got there?

    Where are you seeing this picture?
    Its really tough for another user to tell you where the picture came from ...email attachment? ...screen shot?....saved from the Internet?
    It had to be something that you or someone else did on your iPad for this picture to appear - some user action had to be involved.

  • How do I add my Applications fold back onto the dock? People say I must drag it near the trash can, but that just puts it past that barrier. I am trying to get it back to where it disappeared from, on the left hand side near the finder icon.

    How do I add my Applications fold back onto the dock? People say I must drag it near the trash can, but that just puts it past that barrier. I am trying to get it back to where it disappeared from, on the left hand side near the finder icon. And how / why did it disappear?

    With respect, you actually cannot store folders on the left side of the Dock - only on the right side. I wonder if you're talking about Launchpad, which looks like a silver rocket and shows you your installed applications? It's not actually a shortcut to the Applications folder, though. You can certainly drag Launchpad into the left side of the Dock from the Applications folder.
    Matt

  • Does anyone know how to permanently remove a device that is trying to pair with my computer? I don't know what this device is or where it came from. I just want it gone. Thanks

    Does anyone know how to permanently remove a device that is trying to pair with my computer? I don't know what this device is or where it came from. I just want it gone. This is the name of the device ArbAx6h2P6.

    If it's a bluetooth device:
    Bluetooth: How to delete a paired device:
    http://support.apple.com/kb/ta27116

  • I had a very very small greenish like color dot in my ipod touch screen... I don't know how nd where it came from...

    I had a very very small greenish like color dot in my ipod touch screen... I don't know how nd where it came from...

    Lickey this problem:
    About LCD display pixel anomalies for Apple products released in 2010 and later

  • I have a photo album called "My photos" and i dont know where it came from and i dont know how to delete it

    I have a photo album called "My Photos" and i dont know where it came from and i dont know how to delete it.

    Did you synch it from your computer?

  • Four straight lines have appeared on my screen, top to bottom.  Any idea where the came from, and can they be removed?  These all come within the past few days.

    Four straight lines have appeared on my screen, top to bottom.  Any idea where the came from, and can they be removed?  These all come within the past few days.

    It's most likely the Display going out on a few lines, but can be Graphic card related, which model & display?

  • Modifying StrobeMediaPlayback to choose closest server to request stream from

    Hello and thanks in advance for any help here.
    I am looking for a way to modify SMP to intelligently decide what server to request a stream from. Basically it needs to act as a sort of primitive geographic-based load balancing solution. I've downloaded the SMP source and haven't been able to identify where exactly it initializes a netconnection and netstream. If anyone would have information about this or anything else that would lead me closer to implementing this modification, it would be greatly appreciated.
    Thanks a lot.

    Thanks for the replies. I added the following lines:
         strm.getStreamInfo();
         strm.streamInfo.append = true;
         strm.onStartRecord();
    The problem now is that if I set the stream type to DVR in the Strobe player, I get the following odd behavior for video from FMLE:
         With autoPlay enabled in the player
    Video only plays properly about one in 20 playback attempts; the rest of the time it shows up as a black video.
    When it does play properly, it plays from the live point in the video and shows the cursor in the "live" area of the scrub bar as it should
         With autoPlay disabled in the player
    Video appears to play properly
    It shows that it's at the "live" point in the scrub bar, but it insists on playing the video from the beginning
    In addition to those issues, the code changes above don't seem to fix the crazy video durations when recording and playing back from the VBrick (e.g. 268 hours when it's only a few minutes). Assuming I could actually get the videos to record and playback with DVR controls from FMLE (which I am becoming increasingly doubtful of this right now), is there a way to have the server insert the timecode or whatever is missing so it doesn't get so confused? I've looked at the logs and added more trace statements and it appears to be using a reasonable startRec time so this might be some sort of missing VITC timecode issue.
    I still find it extremely hard to believe that I'm the only person trying to record to and playback video with DVR controls from FMS without an explicit DVR record start/stop and that I'm also the only person doing it from other video sources besides FMLE. What am I missing? Why is this so hard?
    The DVR app from Wowza combined with Wowza Media Server provided this functionality of the box and the only reason we're not 100% sold on using that as our solution is that we can't get the live latency down below 20sec because it can only do HTTP out instead of RTMP out.
    Thanks,
    Jim

  • Getting error while passing implicit request object from JSP to JavaBean

    Hi,
    I am getting error while passing implicit object ie( request object)
    from within JSP to JavaBean.
    Following is source for JSP, JavaBean and Error message I am getting.
    vaLookup.jsp Source
    <jsp:useBean id="db" class="advisorinsight.javabeans.DisplayPages"
    scope="request">
    <jsp:setProperty name="db" property="request" value="<%= request %>"
    />
    </jsp:useBean>
    <jsp:getProperty name="db" property="totalrecords" />
    JAVABEAN DisplayPages.java source
    package javabeans;
    import java.io.Serializable;
    import javax.servlet.http.HttpServletRequest;
    public final class DisplayPages implements Serializable {
    private String totalrecords;
    private HttpServletRequest request;
    public void setRequest(HttpServletRequest req){
    this.request = req;
    public java.lang.String getTotalrecords()
    this.totalrecords =
    this.request.getParameter("totalrecords");
    return this.totalrecords;
    public DisplayPages(){
    totalrecords = "";
    request = null;
    error after executing vaLookup.jsp
    [30/Nov/2001 11:56:04:5] info: EXTMGR-006: GXExtensionManager: Extension
    service JavaExtData successfully loaded
    [30/Nov/2001 11:56:04:5] info: EXTMGR-006: GXExtensionManager: Extension
    service LockManager successfully loaded
    [30/Nov/2001 11:56:04:5] info: EXTMGR-006: GXExtensionManager: Extension
    service RLOPManager successfully loaded
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:5] info: REQ-012: thread add
    [30/Nov/2001 11:56:04:7] info: ENGINE-ready: ready: 10819
    [30/Nov/2001 11:56:46:0] info: --------------------------------------
    [30/Nov/2001 11:56:46:0] info: JSPRunnerSticky: init
    [30/Nov/2001 11:56:46:0] info: --------------------------------------
    [30/Nov/2001 11:56:51:7] error: Exception: SERVLET-compile_failed:
    Failed in compiling template: /va/valookup.jsp, javac error:
    c:\iplanet\ias6\ias\APPS\variabl
    S\va\valookup.java:76: Undefined variable: JSP_8
    db.setRequest(_JSP__8);
    ^
    1 error
    Exception Stack Trace:
    java.lang.Exception: javac error:
    c:\iplanet\ias6\ias\APPS\variableannuity\va\WEB-INF\compiled_jsp\jsp\APPS\va\valookup.java:76:
    Undefined variable: JSP_8
    db.setRequest(_JSP__8);
    ^
    1 error
    at
    com.netscape.server.servlet.jsp.JSPCompiler.compileJSP(Unknown Source)
    at
    com.netscape.server.servlet.jsp.JSPCompiler.compileOrLoadJSP(Unknown
    Source)
    at
    com.netscape.server.servlet.jsp.JSPCompiler.compileInstance(Unknown
    Source)
    at
    com.netscape.server.servlet.jsp.JSPCompiler.compileInstance(Unknown
    Source)
    at
    com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callJspCompiler(Unknown
    Source)
    at
    com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUri(Unknown
    Source)
    at
    com.netscape.server.servlet.platformhttp.PlatformHttpServletResponse.callUriRestrictOutput(Unknown
    Source)
    at
    com.netscape.server.servlet.platformhttp.PlatformRequestDispatcher.forward(Unknown
    Source)
    at com.netscape.server.servlet.jsp.JSPRunner.service(Unknown
    Source)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
    at
    com.netscape.server.servlet.servletrunner.ServletInfo.service(Unknown
    Source)
    at
    com.netscape.server.servlet.servletrunner.ServletRunner.execute(Unknown
    Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.applogic.AppLogic.execute(Unknown Source)
    at com.kivasoft.thread.ThreadBasic.run(Native Method)
    at java.lang.Thread.run(Thread.java:479)

    The only thing that I see that looks funny to me is when you pass the request object into the method using <%=request%>, Im not sure whats going to happen here because that is suppose to print the results. Have you tried simply using <%request%>?

Maybe you are looking for