Posts Topics Forums Images
Search videos from message boards Videos Search messages from microblogs Microblogs Search messages from imdb.com Imdb Search messages from yuku.com Yuku Search messages from lefora.com (free forums) Lefora
My account: Login | Sign Up
Loading... 

Thread: Finder password dialog with Java

Started 1 month, 3 weeks ago by Transporteur
Hi guys I'm doing some Java IO stuff at the moment, which is fine if you are working on a single computer with read/write access to every folder. Assuming that I want to copy a file to a network folder that is mounted using the guest account, is there any option to open the OS X password dialog that asks for the correct username and password in order to get full access to that ...
Site: Mac Forums - Mac News and Rumor Discussion  Mac Forums - Mac News and Rumor Discussion - site profile
Forum: Mac Programming  Mac Programming - forum profile
Total authors: 5 authors
Total thread posts: 14 posts
Thread activity: no new posts during last week
Domain info for: macrumors.com

Other posts in this thread:

chown33 replied 1 month, 3 weeks ago
The first thing that comes to mind is to exec the authopen command. http://developer.apple.com/mac/libra...uthopen.1.h tml I recommend you try it first in a Terminal shell window. Also, be sure to use the String[] form of exec(), not the single-String form.

Transporteur replied 1 month, 3 weeks ago
Unfortunately I'm absolutely not familiar with the Terminal, especially when it comes to implement such commands in my Java code. Isn't there a command Apple offers to open that Finder dialog that asks for permission to change the folder?

robbieduncan replied 1 month, 3 weeks ago
The "Finder Dialog" is provided by Authorisation Services in OSX. It enables an application to get permission to and then actually perform a privileged action. In a normal OSX app you would just use this. There is no direct Java equivalent as this is platform specific. I would recommend writing a small tool that is OSX native in a native language (like Objective-C) to get access to ...

chown33 replied 1 month, 3 weeks ago
Google for: authorization mac os x java Top hit: http://www.amug.org/~glguerin/sw/#authkit

lee1210 replied 1 month, 3 weeks ago
Authorization Services are normally the "right answer", but in this case the OP wants to get a username and password for a remote system. Escalating to a privileged local account isn't going to buy access to these remote resources. I'm unfamiliar with java gui programming, but i can only assume that there is a form of input that obscures what is being typed with bullets, etc. I would just ...

robbieduncan replied 1 month, 3 weeks ago
Ah, yes, I see. I mis-read the original question. Once you get the username and password what are you going to do? Mount manually via a command-line tool?

Transporteur replied 1 month, 3 weeks ago
I finally found it by accident last night at 4am. Instead of choosing a file/directory using the java.swing JFileChooser, you have to use java.awt FileDialog. Not only does it look like Apples native dialog, it supports Apples 'connect as...' feature which is exactly what I am looking for. Thank you anyway for your support. Appreciate it!

robbieduncan replied 1 month, 3 weeks ago
That may be because Apple supply a custom AWT for Mac OSX...

Transporteur replied 1 month, 3 weeks ago
I didn't know that. I am not a subscribed developer yet (free though, but that doesn't really count), so it's pretty hard to get proper information, or do I miss a source on the Apple developers site?

robbieduncan replied 1 month, 3 weeks ago
Quote: Originally Posted by Transporteur I didn't know that. I am not a subscribed developer yet (free though, but that doesn't really count), so it's pretty hard to get proper information, or do I miss a source on the Apple developers site? It's something I remember from way back when people wanted to get ...

 

Top contributing authors

Name
Posts
Transporteur
6
user's latest post:
Finder password dialog with Java
Published (2009-11-03 13:33:00)
That's very useful when it comes to port my program to the Windows platform as it's awt does not support the feature. Thank you very much!
robbieduncan
4
user's latest post:
Finder password dialog with Java
Published (2009-11-03 12:44:00)
Quote: Originally Posted by Transporteur I didn't know that. I am not a subscribed developer yet (free though, but that doesn't really count), so it's pretty hard to get proper information, or do I miss a source on the Apple developers site? It's something I remember from way back when people wanted to get the OSX L&F from Java on the Mac on other platforms and it became clear that Sun couldn't do that as...
chown33
2
user's latest post:
Finder password dialog with Java
Published (2009-11-03 11:12:00)
Google for: authorization mac os x java Top hit: http://www.amug.org/~glguerin/sw/#authkit
lee1210
1
user's latest post:
Finder password dialog with Java
Published (2009-11-03 11:25:00)
Authorization Services are normally the "right answer", but in this case the OP wants to get a username and password for a remote system. Escalating to a privileged local account isn't going to buy access to these remote resources. I'm unfamiliar with java gui programming, but i can only assume that there is a form of input that obscures what is being typed with bullets, etc. I would just get the password in there,...
pikester
1
user's latest post:
Finder password dialog with Java
Published (2009-11-03 13:23:00)
You can use your own GUI to get a username, password, and (optionally) the domain. You can then pass this information to a Mac utility to mount the drive. Assuming that you are trying to mount a SMB drive (i.e. a Windows mount), you can try something like this: Code: // Mount the drive String[] cmd1 = {"/sbin/mount_smbfs", "//domain;username:password@server/share", "/path/to/dir"}; Process...

Related threads on "Mac Forums - Mac News and Rumor Discussion":

Related threads on other sites:

Thread profile page for "Finder password dialog with Java" on http://www.macrumors.com. This report page is a snippet summary view from a single thread "Finder password dialog with Java", located on the Message Board at http://www.macrumors.com. This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity