• 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: Standard authentication interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Standard authentication interface


  • Subject: Re: Standard authentication interface
  • From: James Bucanek <email@hidden>
  • Date: Fri, 28 Apr 2006 07:20:16 -0700

Julio Bianco wrote on Thursday, April 27, 2006:

>Hi again,
>I try to create a dialog interface able to ask for a user and
>password, and then be able to run a program with this user
>permissions. I need to know if there is a standard way to solve it.
>Is there a class that provides us with this kind of dialog boxes?

There is no Cocoa interface for this, but the C/Carbon interface to authorization and authentication services are pretty straight forward.

Essentially, you need to obtain an authorization to perform your action. This, indirectly, calls the authentication services. In the absence of any other kind of authentication, the system will present the user with the standard authentication dialog asking for their administrator's account name and password. Once you have an authorization, you want to call AuthorizationExecuteWithPrivileges() to run your program.

[ Note: This technique is simple but not a particularly secure or safe way of executing code. Simply getting an authorization and executing some program with root privileges should not be use in programs you plan on distributing to others. The Authorization Services documentation explains how to create a more secure "helper tool" arrangement that passes the authorization to the tool for use there. There are also example projects which demonstrate this. ]

Start here to learn about the details: <http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/index.html#//apple_ref/doc/uid/TP30000995>

--
James Bucanek
 _______________________________________________
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: Standard authentication interface
      • From: Ondra Cada <email@hidden>
References: 
 >Standard authentication interface (From: Julio Bianco <email@hidden>)

  • Prev by Date: Re: OT cocoa groups in NYC
  • Next by Date: Re: Re-wrapping cells in an NSMatrix with bindings
  • Previous by thread: Re: Standard authentication interface
  • Next by thread: Re: Standard authentication interface
  • Index(es):
    • Date
    • Thread