<!--
{
  "availability" : [
    "macOS: 10.3.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SecurityInterface",
  "identifier" : "/documentation/SecurityInterface/SFAuthorizationPluginView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Security Interface"
    ],
    "preciseIdentifier" : "c:objc(cs)SFAuthorizationPluginView"
  },
  "title" : "SFAuthorizationPluginView"
}
-->

# SFAuthorizationPluginView

Allows authorization plug-in developers to create a custom view their plug-in can display.

```
class SFAuthorizationPluginView
```

## Overview

If you’re developing an authorization plug-in, you can subclass the [`SFAuthorizationPluginView`](/documentation/SecurityInterface/SFAuthorizationPluginView) class to create views that provide a custom user interface for your plug-in. By subclassing the [`SFAuthorizationPluginView`](/documentation/SecurityInterface/SFAuthorizationPluginView) class, you avoid changing or duplicating the Apple-provided authentication or login window dialogs to display your custom view.

To instantiate your [`SFAuthorizationPluginView`](/documentation/SecurityInterface/SFAuthorizationPluginView) subclass, you need the callbacks structure containing entry points to the Security Server that you receive in your plug-in’s <doc://com.apple.documentation/documentation/Security/AuthorizationPluginCreate> function and the authorization engine handle you receive in your plug-in’s <doc://com.apple.documentation/documentation/Security/AuthorizationPluginInterface/MechanismCreate> function.

Your custom subclass of [`SFAuthorizationPluginView`](/documentation/SecurityInterface/SFAuthorizationPluginView) must override the following methods:

- [`buttonPressed(_:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/buttonPressed(_:))
- [`view(for:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/view(for:))

## Topics

### Initializing an SFAuthorizationPluginView Object

[`init(callbacks:andEngineRef:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/init(callbacks:andEngineRef:))

Initializes a new authorization plug-in view with the specified callbacks and authorization engine handle.

### Getting Instance Information

[`callbacks()`](/documentation/SecurityInterface/SFAuthorizationPluginView/callbacks())

Returns the authorization callbacks structure with which this instance was initialized.

[`engineRef()`](/documentation/SecurityInterface/SFAuthorizationPluginView/engineRef())

Returns the authorization engine handle with which this instance was initialized.

[`lastError()`](/documentation/SecurityInterface/SFAuthorizationPluginView/lastError())

Returns the last error that occurred during evaluation.

### Responding to User Actions

[`buttonPressed(_:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/buttonPressed(_:))

Tells the authorization plug-in that the user pressed a button in the custom view.

[`view(for:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/view(for:))

Returns the appropriate view object for the specified view type.

### Configuring the User Interface

[`didActivate()`](/documentation/SecurityInterface/SFAuthorizationPluginView/didActivate())

Tells the authorization plug-in when its user interface has become active.

[`didDeactivate()`](/documentation/SecurityInterface/SFAuthorizationPluginView/didDeactivate())

Tells the authorization plug-in that its user interface has been deactivated.

[`willActivate(withUser:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/willActivate(withUser:))

Tells the authorization plug-in that its user interface is about to be made active by the Apple-provided Security Agent.

### Setting Up the Keyboard Loop

[`firstKeyView()`](/documentation/SecurityInterface/SFAuthorizationPluginView/firstKeyView())

Returns the first view in the keyboard loop of the view.

[`firstResponder()`](/documentation/SecurityInterface/SFAuthorizationPluginView/firstResponder())

Returns the view that should get focus for keyboard events.

[`lastKeyView()`](/documentation/SecurityInterface/SFAuthorizationPluginView/lastKeyView())

Returns the last view in the keyboard loop of the view.

### Enabling and Disabling Controls

[`setEnabled(_:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/setEnabled(_:))

Enables or disables the controls in the authorization plug-in’s view.

### Communicating with the Authorization Plug-in

[`display()`](/documentation/SecurityInterface/SFAuthorizationPluginView/display())

Displays the user interface provided by the authorization plug-in view subclass.

[`setButton(_:enabled:)`](/documentation/SecurityInterface/SFAuthorizationPluginView/setButton(_:enabled:))

Enables or disables a button in the authorization plug-in’s user interface.

[`update()`](/documentation/SecurityInterface/SFAuthorizationPluginView/update())

Tells the authorization plug-in to get and display the appropriate view in the authorization plug-in’s user interface.

### Constants

[`SFButtonType`](/documentation/SecurityInterface/SFButtonType)

These constants define the button types used by authorization plug-ins.

[`SFViewType`](/documentation/SecurityInterface/SFViewType)

These constants define the view type requested by the authorization plug-in.

[Exceptions](/documentation/SecurityInterface/exceptions)

Exceptions thrown by the `SFAuthorizationPluginView` class



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)