Getting the password hint of the user

I would like to know how to programmatically get, set, and display the password hint for a user in the login screen.

Thanks

This is stored in the kODAttributeTypeAuthenticationHint attribute of the user’s Open Directory record. You can get this from the command line like so:

% sudo dscl localhost -read /Search/Users/mrgumby AuthenticationHint
AuthenticationHint:
 something to do with doors

Note that you have to run dscl as root for this to work.

Programmatically, you’d get this attribute like you would any other attribute, using the Open Directory framework.

Sample code for the OD framework is kinda thin on the ground, but a good place to start would be the code in this post.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Getting the password hint of the user
 
 
Q