Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

Multiple views in SFAuthorizationPluginView

Hi there,

I'm trying to use SFAuthorizationPluginView in order to show some fields in the login screen, have the user click the arrow, then continue to show more fields as a second step of authentication. How can I accomplish this?

  1. Register multiple SecurityAgentPlugins each with their own mechanism and nib?
  2. Some how get MacOS to call my SFAuthorizationPluginView::view() and return a new view?
  3. Manually remove text boxes and put in new ones when button is pressed

I don't believe 1 works, for the second mechanism ended up calling the first mechanism's view's view()

Cheers,

-Ken

Answered by DTS Engineer in 838434022

Regarding option 1, I usually recommend that you have a single plug-in with multiple mechanisms, rather than have multiple plug-ins. The challenge with doing that here is that there’s only one nib file (denoted by NSMainNibFile) for the whole plug-in, and when the system loads the nib it has to have a single unique owner. You could probably make that work, but it’d be tricky.

Of course, you could abandon nibs entirely, which isn’t always a terrible option.

However, I’m also concerned about what happens to all the window ‘chrome’ when you switch between mechanisms.

Honestly, option 3 sounds like the easiest choice. The area within your root view is yours to control.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Regarding option 1, I usually recommend that you have a single plug-in with multiple mechanisms, rather than have multiple plug-ins. The challenge with doing that here is that there’s only one nib file (denoted by NSMainNibFile) for the whole plug-in, and when the system loads the nib it has to have a single unique owner. You could probably make that work, but it’d be tricky.

Of course, you could abandon nibs entirely, which isn’t always a terrible option.

However, I’m also concerned about what happens to all the window ‘chrome’ when you switch between mechanisms.

Honestly, option 3 sounds like the easiest choice. The area within your root view is yours to control.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you for your response, Quinn. I'll do #3.

Multiple views in SFAuthorizationPluginView
 
 
Q