Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Built-in password authentication dialog in Cocoa?

Is there a built in username/password dialog box in Cocoa? I don't want to reinvent this if there's a standard way of doing it, but after googling, I came up with nothing.

I often see that lock image with the application image superimposed on it, so I thought there might be something.

like image 929
nall Avatar asked Oct 07 '09 23:10

nall


1 Answers

There is NSSecureTextField, a control (NSTextField subclass) for entering secure text (it shows • instead of the typed letters and doesn't allow copying to a non-secure text field), but there is no standard authentication dialog in Cocoa for arbitrary use.

The Authorization Services framework will display the standard dialog when needed (i.e. in response to a request to the framework), but I don't believe you can co-opt this dialog for your own purposes (nor should you; it would be a serious mistake to let users think they were authorizing a privileged action according the understood meaning of the dialog when you were using the dialog with a different intent).

like image 111
Barry Wark Avatar answered Oct 04 '22 14:10

Barry Wark