0

If I have the following users on my MAC: test1, test2 and test3

And I am logged into test1. And I would like to enable certain feature for test2 through my application. Hence the user test1 has to authenticate by entering the credentials for test2. Is it possible via cocoa?

I tried dscl command, but i did not find anything useful.

As an example: When u click enable users in file vault, it shows a tableview with other users on the mac. And then when u click enable, it asks for the user name and password and authenticates the other user. I am trying ti achieve something similar to this.

Shanti K
  • 2,873
  • 1
  • 16
  • 31
  • You're looking for Authorization Services. People are most familiar with that API for gaining OS-level privileges, but you can define your own rules and use them just to restrict your own app's behavior. See the [guide](https://developer.apple.com/library/mac/documentation/Security/Conceptual/authorization_concepts/01introduction/introduction.html), specifically references to "self-restricted applications". – Ken Thomases Nov 11 '14 at 03:42
  • I don't want to restrict just the app behaviour. – Shanti K Nov 11 '14 at 06:13

1 Answers1

2

I got a way of authenticating any user on the mac. This can be done using CSIdentity. The function CSIdentityAuthenticateUsingPassword does the needful.

Shanti K
  • 2,873
  • 1
  • 16
  • 31