简体   繁体   中英

accepting only Request from specific server to my asp.net pages

Hello guys i have server "A" where i would like to put a link to an application to server "B". Server "A" is a unix machine running java and redhat linux. when user come to server "A" they must first authenticate so that they can get to see the application in server "A". What i like to do now is leverage server "A"'s authentication and basically allow the user to see the page rendered page on server "B" if and only if he has be authenticated on server A.(server "A" sets a cookie i believe) I would want to make the page on server B check wheter the user is authenticated and its coming from server "A". If it is then render the page if its not then redirect the user back to server A to authenticate. Server "B" its a windows machine running windows server 8 64bit. Can someone point me in the right direction This seems possible however im not sure how to accomplish. Thanks in advance.

The answer to this its not possible there are few script out there that go like this

public string GetIPAddress() 
  { 
     string strHostName = System.Net.Dns.GetHostName(); 
     IPHostEntry ipHostInfo = Dns.Resolve(Dns.GetHostName()); 
     IPAddress ipAddress = ipHostInfo.AddressList[0]; 

     return ipAddress.ToString(); 
  } 

This returns the ip address of the server your are on but not the server that it actually making a post or a get request to this server. The closest thing that you could get is the best source that i have been able to find is this,

Request.ServerVariables["HTTP_REFERER"];

This gives me the hostname of the server making a call.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM