• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Save authentication to keychain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Save authentication to keychain


  • Subject: Re: Save authentication to keychain
  • From: Colin Cornaby <email@hidden>
  • Date: Sat, 6 Aug 2005 15:03:48 -0700

I don't think you can. You are essentially handed a id for your session to launch using privs, but that session will expire on it's own eventually. You could save that session id with a keychain, but I don't think it would much good. You'd have to reuse it before it expires.

There are a few ways around. You could create a background daemon which you can launch with privileges, and it in turn would do privileged operations. Your app could communicate with it using notifications. In since the daemon would stay open your privileges wouldn't expire. The second way is not as nice, but you could manually prompt the user for their admin password, and then manually use the sudo tool to do your dirty work. You'd have the user's password at your disposal for whenever you need to do something. I would recommend against this approach.

If you are looking for a way to keep the daemon priv's from session to session you might be able to do some trickery by setting it's owner to root, but I can't think of a way to actually re-launch the daemon without gained root privs in your app again.

On Aug 6, 2005, at 12:53 PM, Jerry Brace wrote:

Does anyone know how to save authentication information to the keychain?
My app requires access to a unix binary as root and after prompting for authentication it times out after a period of time. I'd like to save that information where the app can retrieve it whenever it needs it. Any ideas?


Many thanks,
Jerry


--------------------------- Colin Cornaby - http://gomac.blogspot.com/ Carpe Stellarem - Lead Programmer, ProToys - http://carpestellarem.com Macintosh Specialist - University of Portland - htttp://up.edu

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Save authentication to keychain
      • From: Finlay Dobbie <email@hidden>
References: 
 >Save authentication to keychain (From: Jerry Brace <email@hidden>)

  • Prev by Date: Re: Save authentication to keychain
  • Next by Date: Re: Save authentication to keychain
  • Previous by thread: Re: Save authentication to keychain
  • Next by thread: Re: Save authentication to keychain
  • Index(es):
    • Date
    • Thread