I tried many solutions but i'm just getting mac address of the server. I need to get mac address of the client machine. Is this possible to get mac address of the client machine?
If not, is this possible to get any other unique id from client machine?
The short answer is: No
It is not possible to get the MAC address from the client using JavaScript as this will pose a serious security risk.
The only unique id you will be able to get is the IP address, but this will possibly not be unique as the user's machine might be NATed behind a router.
You could use an ActiveX control on Java applet to get the client machine's MAC address, but this would require installation of the chosen method on the client machine and will never be a fail-safe way of obtaining the MAC address.
Related
So the problem is this, I created a restful selfhosted api, to work with my mobile app, on the app mobile I stored my public ip (190.xxx.xxx.xxx) when I try to consume the api from the same network donset work no response, If I go 3g or in anoter network its work fine.
I try on my browser those 2 situation:
http://localIp:port/api/Menu/... its work
http://externalIp:port/api/Menu/... dont work - ps. this work only if I on a diferent network or 3g.
But I need to keep sotored my plubic IP for the external users and I dont want to store 2 ips internal and external to check if the user is on local network or external.
in summary my clients can use the app outside the office, but in the office with wifi connected they cant.
Tks for anyhelp
I found this and solve my problem
https://docs.connectwise.com/ConnectWise_Control_Documentation/On-premises/On-premises_knowledge_base/Cannot_access_external_IP_address_from_LAN
Introduction
In some scenarios, a user cannot use an external IP address to access a machine on their local network. This is typically a result of security measures put in place by routers and referred to as a Network Address Translation (NAT) loopback issue. This article will discuss what this means for ConnectWise ControlĀ® on-premises users and will provide some suggestions.
What is NAT loopback?
Many routers and some security tools prevent loopback connections as a security feature. This means that a machine on your local network cannot connect to the external IP address (such as 208.112.93.73) of a machine that is also on your local network. Connecting to a local IP address (such as 192.168.0.2) of that same machine works fine.
I have WCF service hosted as windows service, I am trying to get clients (WPF client) Mac address at server end (WCF side). I have tried using following line of code but it gives me IP address of client that too in ::1 format. RemoteEndpointMessageProperty prop = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
prop.Address is ::1
How can I get client Mac address so that I can differentiate among the client hitting my service. There could be scenarios where clients under same network may give me same IP address and that is reason I am looking for Mac address to identity client's call..
This question got closed and marked duplicate however its not something related to IP address. I am looking for Mac address!!! Please let answers come and don't close this!!!
You can only get MAC address on the same subnet as the sever so it will not be more unique than client IP.
There is no dotnet API to get the address within the same subnet but if you really want you can try running an external program and captiapturr the output, see options listed
https://superuser.com/questions/188799/how-to-find-the-mac-address-of-a-remote-computer
I am trying to find a solution to get the client's iPad unique MAC/Wifi address. I found some solutions here but it gets the MAC address of the server, but I want the client's address.
Thanks.
It is not possible to retrieve the clients MAC address, the MAC address is determined by the clients hardware and due to many restrictions your web application tipically canĀ“t get it.
I tried various workarrounds using javascript a long time ago without any success.
Here is a more detailed discussion about the same topic:
how to get mac address of client that browse web site by asp.net mvc c#
I want to get client computer MAC address and IP at the time of login for purpose of uniquely identify the client computer.
To get the user's IP address you can use Request.UserHostAddress or Request.ServerVariables["REMOTE_ADDR"].
Getting the MAC address I am not sure it is so simple. It is not something that is available to the server (ASP.NET) like the IP address is. From what I know you will need to use client scripting and ActiveX or Java applets to get to that information (after multiple installation and security prompts on the users' machines).
So in other words, get IP address by Request.UserHostAddress. Avoid using MAC address and look for another solution if IP is not unique enough for your needs. Maybe combine it with browser User Agent string instead (Request.ServerVariables["HTTP_USER_AGENT"] or Request.UserAgent but the latter might not be available in older versions of .NET).
You can get client IP address from request objects UserHostAddress property like
Page.Request.UserHostAddress
Looks like there is no straight forward way of getting client MAC address except using WMI which other answers already have pointed on.
refer to the below link , may be they will be useful for you...
http://forums.asp.net/t/1911211.aspx?Get+Client+Mac+Address+in+Asp+Net+Web+Application
http://www.codeproject.com/Answers/187064/i-need-MAC-Address-of-client-machine-using-asp-net#answer1
Is it possible that store IP and/or MAC address of client system in Cookie in ASP.NET
It is possible to store anything relatively small (<100K) in cookies, obtaining information is whole other story.
After you obtained IP / MAC (hard to do on web page, and "really useful IP" is pretty much non-existent thing) you may need to encode value to put in cookies.
Obtaining MAC - not possible via normal JavaScript. Trusted site/trusted control may be able to obtain one MAC addresses in JavaScript.
Obtaining IP - externally visible IP is available on your server as header, you can also find existing service that will give you such IP. Note that it most cases it is different from IP of local machine visible locally.
The IP address of the user is stored in Request.UserHostAddress.