• 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: How do you make the Authenticate dialog front and key?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do you make the Authenticate dialog front and key?


  • Subject: Re: How do you make the Authenticate dialog front and key?
  • From: Bruce Lacey <email@hidden>
  • Date: Mon, 21 Apr 2003 19:34:05 -0700

Nick,

Thank you for explaining that the Authenticate window behavior I was experiencing was due to an expired or invalid authorization reference in an AEWP call. This was certainly the key to diagnosing and resolving my problem. I was setting up the framework to pre-authorize the user so given your explanation of the behavior, I inspected the code looking for some other reason why the authorization reference might not be valid at the time that I make the AEWP call. It turns out that I had a error in the way that I was setting one of the elements in AuthorizationItem structure prior to calling AuthorizationCopyRights().

Thank you very much for your timely and most helpful response,
Bruce


On Monday, April 21, 2003, at 05:44 PM, Nick Zitzmann wrote:


On Monday, April 21, 2003, at 04:06 PM, Bruce Lacey wrote:

In my ApplicationDidFinishLaunching delegate method of my application controller, I initialize an authorized task controller (AuthTaskController) that manages an authorized task (agent). The AuthTaskController's initialization method launches an agent using the Authorization Services API. The AuthTaskController calls AuthorizationCopyRights() to create the authorization reference with the kAuthorizeFlagInteractionAllowed flag and the AuthorizationExecuteWithPrivileges() is subsequently called which in turn prompts the user for their name and password using a window called "Authenticate" (all provided by the Authorization Services.

However, the "Authenticate" window does not behave as I would expect. I expected the "Authenticate" window to be the front-most window and for the password text field to be the default entry field.

This can happen if you didn't set up the framework to pre-authorize the user. If you try and call AEWP without first pre-authorizing, or if the authorization expires, then the authorization window will display but it won't be made key. I don't know why, but that's the way it is. (And under OS X 10.1.5 and earlier, the authorization dialog will appear to represent "AuthorizationTrampoline" instead of your own application.)

When you call AuthorizationCopyRights(), pass in kAuthorizationFlagPreAuthorize as a flag (among the other flags, you can use the logical OR to put them together) and this shouldn't be a problem anymore, unless the rights expire... I'm not sure how to keep the rights from expiring, other than just holding the program open.

Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page: http://dreamless.home.attbi.com/

"Building the future and keeping the past alive are one and the same thing." - Metal Gear Solid 2
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: How do you make the Authenticate dialog front and key? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Membership
  • Next by Date: about Rendez-vous and Distributed Object
  • Previous by thread: Re: How do you make the Authenticate dialog front and key?
  • Next by thread: Fwd: problems with NSMovieView (but may be obj alloc mistakes)
  • Index(es):
    • Date
    • Thread