Re: How do you make the Authenticate dialog front and key?
Re: How do you make the Authenticate dialog front and key?
- Subject: Re: How do you make the Authenticate dialog front and key?
- From: Nick Zitzmann <email@hidden>
- Date: Mon, 21 Apr 2003 17:44:07 -0700
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.