Hi,
I have experienced undocumented changes in the behavior of SFAuthorizationPluginView and Authorization Plug-ins while testing our Auth Plugin under macOS Sonoma Beta 3 (latest seed as of today).
Prerequisites:
- macOS Sonoma Beta 3
- Settings > Lock Screen > Login window shows: List of Users
Note: it is visible the login screen changed in behavior, this can be noticed even without the installation of any authorization plugin. There is now a default selected user with the password field always visible. Up until Ventura, a user had to be picked manually first to then open up their login password textfield.
After logout I noticed that the order of delegate methods have changed.
Previously, until macOS Ventura the order of methods seemed to be:
displayView()
--> viewForType()
--> view.viewDidLoad() --> willActivateWithUser()
--> firstResponder
--> didActivate()
where view is my custom NSViewController.view embedded in the SFAuthorizationPluginView. viewDidLoad
is called because my implementation of viewForType
returns view - which in turn should call loadView()
based on documentation for NSViewController.view
:
If this property’s value is not already set when you access it, the view controller invokes the loadView() method.
Now it seems that the order has changed:
displayView()
--> didActivate()
--> firstResponder
This means that viewForType()
, willActivateWithUser()
are not called. And then my console application crash log shows that the application crashed at firstResponder
, probably because view.viewDidLoad() is not called for my view due to viewForType()
not being called either.
Has anyone met a similar issue? This really seems like an undocumented change.
- macOS Ventura 13.3, plugin built with XCode 14.3.1 -> our app works
- macOS Sonoma 14.0 Beta3, plugin built with XCode 14.3.1 -> our app does not work
- macOS Sonoma 14.0 Beta3, plugin built with XCode 15.0 Beta4 -> our app does not work
P.S.: I do see methods new in macOS Sonoma appeared for NSViewController, like loadViewIfNeeded - but sadly these new methods have zero documentation attached.
P.S #2: I have checked with a minimal repro example, and the order has indeed changed. When the view does not have to be loaded via an NSViewController, i can see the full new order:
displayView()
--> didActivate()
--> firstResponder
--> viewForType()
--> willActivateWithUser()
--> didActivate()
(called twice??) --> firstResponder
--> firstResponder
This above order of calls is without a single user interaction, just logging out (or using security authorize -u system.login.console
from the terminal)