How we can get unique information about the iPad? - java

I have a Java web application. I want to get the Ipad name or serial number or UDID or other information when the user access to my app.
If you have any solution to this. Can you tell me how to get there?
Thank you so much.

It is intentionally not possible for a web site (written in any language) to be able to get uniquely identifiable information about each visitor's hardware, so unless you can control the browser or other app that is being used (on the iPad) to make the request, there's no way to do what you want.
The only information your web server will receive about the visitor is the information they disclose in the HTTP request they make (user agent string, cookies, their IP address, etc.).

Related

identify the hardware device using java

I have developed a web application.Same user(same login id) can login to the system by using multiple devices. I want to identify the devices seperately. The devices can be ipads,tabs etc...
As an example, there can be 3 ipads .So I need to uniquely identify which ipad was used to login. I need to implement this using java.
Thank you in advance
You cannot really identify each device uniquely because device does not send any type of unique identifier to server.
The typical solution is using cookie. You can create cookie that identifies you each device when it connect first time. The cookie may (for example) take into consideration the client IP, user-agent, timestamp and some random part or, alternatively just create UUID. The cookie should be persisted and never expired.
Now, every time the client connects it sends the cookie and you can identify it.
If you want to detect the device type use User-Agent HTTP header. This will allow you to limit number of devices of the same type as you want.
Obviously user can delete cookie from his browser or use other browser. This is the reason that I mentioned in the beginning of my answer: you cannot really identify the device uniquely. You can however do the best effort explained above.
*I think you can use method
java.lang.System.getProperty(String)
The blow two property be concated will ok.
* <dt>os.name <dd>Operating System Name
* <dt>user.name <dd>User account name*
the above is error.
You cat get client identifier by javascript .java is working with server.

How to get windows user name in java

I write a web application I have to do signin in that using the windows username..
I tried to get username using system.get property() but its giving the username of server windows name only.but I want to the username of client system..can any one help me?
If I understood you correctly you want to sign in to the web application using the Windows credentials. If so - the problem is that the server machine knows nothing about the client. It can provide you the user info only after successful login (see Get windows username using JAVA or JSP).
You could point your system to some user store (e.g. LDAP) that will be used by both Windows system and your app. In this situation you will be able to sign in to the app using Windows credentials.
The Browser is an application to generate the view based on an HTML code. It wont give access to the client machine.
You can use request.getRemoteUser() to get the user name, that too is possible only if its allowed in the client machine.
If your client is running on a windows machine you can get the user name using this
var wshshell=new ActiveXObject("wscript.shell");
var username=wshshell.ExpandEnvironmentStrings("%username%");
This is a solution for getting the user name, but i will never recommend this, it surely is a bad practice.
Is the entire Java application running on the server? How would your application even know about a specific client machine? And how would it deal with concurrently logged in users? And how would it deal with a primitive client machine which does not have a notion of a user name?
You can instead run a Java applet which is invoked on the client's machine. You could the send this information to the server to process. However, your users would most likely not like that and not grant the required privileges.
Alternatively, you could try to use JavaScript to read the user name, in case that you are communicating via a webpage. I want to stress the word try in this context since there is not universally functional approach and most users will most likely not allow you to read this property either.
In a nutshell: Users do not normally want to share this information with you and therefore you cannot access it. If you could, you would have found a security hole which would most likely get fixed. Rather, ask your application's users to enter a name to use for whatever reason you would require it. Or, if this is an option, organize for example your Windows credentials in a service that can be accessed by a standardized API.

How do I get the windows login username of a user running my web application?

I'm trying to get the windows user name of the user in my web application. Can any one suggest how to get it?
I'm developing a web application. So if a user is accessing my application, then I need to get the user's windows id and his host name. I tried a few different ways but it never worked. Any suggestions are highly appreciated.
Windows user details are not sent in plain HTTP requests, which makes it impossible for you to derive them from a user in a web application without additional data.
The host name from which the request is sent is available in the request headers, though.
If you'd still like to get Windows user details, you'll have to do some work, like ask the user to provide them in some form, or, if you have access to the user's Naming/Directory service, you can find things out through his IP/hostname.
This is something you generally don't have readily available in web applications, though.
Im not sure exactly to get the windows user name, but HTML5 The System Information API may provide some useful info. Go through this link once, You may find it helpful.
In YERY OLD(!) version of Internet Explorer the pattern %USER% inside of a URL was replaced by the login username. But with current browsers this doesn't work anymore, and that's good that way.
With JAVA applet you can request it via:
System.getProperty("user.name")
But I don't know if this works for you...
For the intranet case take a look at
How to retrieve the current windows logged on user for Single Sign On purposes in Java
and
Can you get a Windows (AD) username in PHP?
And it seems to be intentionally impossible in common case with modern browsers:
Can your Windows or Linux username be exposed to websites?

Can hardware information by obtained on a device that interacts with a Java servlet?

Is a way to gather hardware information to uniquely identify a certain device (not a category) that makes requests to a Java servlet ? I searched for this, but I don't think there is a method ( "user agent" header can be used for some information, but that only identifies a certain set of devices and it is not enough).
This information is not available anywhere in a HTTP request. The remote address (client IP) and the user agent (the string which the browser pretend to be) are the closest unique identifiers you can ever extract based on a HTTP request. Even then, this information is not reliable. The client can for instance use an anonymous proxy. The client can for instance have changed the browser's user agent string.
You basically need to collect this information in the client side and then send it to the server side as request parameters yourself. You're in turn however limited in the available ways to collect this information. JavaScript for example doesn't allow this due to security reasons. Your closest bet is a signed(!) Java Applet or Web Start application. This allows you to let the client download some Java code and execute it locally. But this is also not always reliable. The client can for instance hack the applet/webstart code and/or tamper the HTTP traffic between the applet and the server.
Another way is to just introduce a registration/authorization/authentication system wherein the client need to supply an unique identifier itself by a valid login. This is not only simpler, but also more robust.

How can I get client side information using either Javascript or Java Servlets?

How can I get client side information using either Javascript or Java Servlets?
Client side information such as client's computer name, its IP Address etc.
Thanks in advance.
You can get some information from the HTTP request headers in a servlet, such as the user-agent (so that you knows which browser the client is using (or want to let us think it is using)) and the remote-addr (the client's IP address (or the proxy's one if the client is using it)).
String userAgent = request.getHeader("user-agent"); // Browser identifier.
String remoteAddr = request.getRemoteAddr(); // IP address.
You can't access system environment variables using Javascript. That would be a security hole. There are ways using ActiveX, but that works only on a certain webbrowser developed by a team in Redmond and still then, the client would need to lower its security settings to allow it to run. That's a big no-no.
The only way to get the computer name is to run a client application which is served by a webpage and let this client application sniff it and send it to the server side. For example a Java Applet using respectively System.getProperty("COMPUTERNAME") and java.net.URL. You however need to sign it, else it will prompt a security warning as well.
Get user IP through JS
var ip = '<!--#echo var="REMOTE_ADDR"-->';
Although I'm not sure on the computer name, I presume it would have to involve ActiveX. It use to be possible via ActivexObject in IE. Unsure if its possible anymore, highly doubt it because its not secure in the slightest.
Depending on your network environment (e.g. if this is on an Intranet), you may be able to get the client name by doing reverse DNS on the client's IP address, or by creating an equivalent server service.

Categories