FAUmac doge AD Authentication Framework package
This framework is a fork and further development of Joel Rennich's NoMAD-ADAuth Framework. It represents his experience and the extensive development hours dedicated to NoMAD's Active Directory authentication.
Many thanks to Joel for his work on NoMAD and NoMAD-ADAuth! Without his ideas and goot work on NoMAD and NoMAD 2 this Framework and our depending apps could never happen!
This framework allows to easily add a robust AD integration to any macOS application.
Overview
The doge AD Authentication Framework allows you to present a username and password to the Framework and have it get tickets for the user and then lookup the user's information in AD. In addition the framework is:
- site aware
- able to change passwords
- able to use SSL for AD lookups
- can have the site forced or ignored
- is aware of network changes, and will mark sites to be re-discovered on changes
- perform recursive group lookups
Adding dogeADAuth to your project
dogeADAuth is a Swift Package Manager(SPM) Package and can imported as usual through Xcode File > Add Package Dependencies... using the project URL
Basic Usage of the Framework via Delegate
- Drag the framework into your project in the Embedded Binaries section of the target
- Import dogeADAuth into your class
- Adopt dogeADUserSessionDelegate, and then add the stubs suggested to conform to the protocol
- create a dogeADSession object
let session = dogeADSession.init(domain: "doge.test", user: "ftest@DOGE.TEST", type: .AD)
- set a password on the session object
session.userPass = "FAUmacDogeADRocks1!"
- set the session delegate to your class
session.delegate = self
- try to authenticate
session.authenticate()
- the delegate callbacks will then let you know if the auth succeeded or not
Basic Usage of the Framework via Closure
- Drag the framework into your project in the Embedded Binaries section of the target
- Import
dogeADAuth
- Make a
dogeADSession
object viainit(domain: String, user: String, type: LDAPType = .AD)
- Set the session's
userPass
variable - Call the session's
getKerberosTicket(principal: String? = nil, completion: @escaping (KerberosTicketResult) -> Void)
function - If the optional
principal
parameter is supplied, this function tries to fetch an existing ticket for this principal, - and then if unsuccessful, continues by trying to get a new ticket
- This function shares its result by running the supplied closure upon completion
- with
KerberosTicketResult
containing either anADUserRecord
on success or adogeADSessionError
on failure