kODPolicyAttributeLastAuthenticationTime

Static kODPolicyAttributeLastAuthenticationTime 

Source
pub unsafe static kODPolicyAttributeLastAuthenticationTime: Option<&'static ODPolicyAttributeType>
Available on crate feature CFOpenDirectoryConstants only.
Expand description

Policy attribute for the time of the last successful auth attempt.

Policy attribute for the time of the last successful auth attempt. CFNumber with a value representing the number of seconds since the Unix epoch. Used in policies to compare against another time.

The sample policy string below would deny authentications if there have been no authentications in the last 90 days.

Note that the number of days needs to be converted to seconds to match the units of kODPolicyAttributeCurrentTime. The special keyword DAYS_TO_SECONDS can be used for the conversion.

[NSString stringWithFormat: “ % @ < % @

  • 90 * DAYS_TO_SECONDS“, kODPolicyAttributeCurrentTime, kODPolicyAttributeLastAuthenticationTime];

See also Apple’s documentation