An authorization request that your provider extension handles.


class ASAuthorizationProviderExtensionAuthorizationRequest : NSObject


Parsing the Request

var url: URL

The complete URL of the request, including all components.

var httpHeaders: [String : String]

The HTTP headers of the request.

var httpBody: Data

The HTTP body of the request.

var realm: String

The realm to which the request applies.

struct ASAuthorizationProviderAuthorizationOperation

A type that represents an authorization operation.

var authorizationOptions: [AnyHashable : Any]

A collection of options associated with the request.

Getting Context

var callerBundleIdentifier: String

The bundle ID of the app making the request.

var extensionData: [AnyHashable : Any]

Extension data from the Mobile Device Management (MDM) configuration.

Interacting with the User

func presentAuthorizationViewController(completion: (Bool, Error?) -> Void)

Asks the authorization service to show the extension’s view controller to the user.

Completing a Request

func complete()

Indicates the requested authorization completed with no output.

func complete(httpAuthorizationHeaders: [String : String])

Indicates the requested authorization succeeded with tokens in the HTTP headers.

func complete(httpResponse: HTTPURLResponse, httpBody: Data?)

Indicates the requested authorization succeeded with an HTTP response.

func complete(error: Error)

Indicates the requested authorization failed.

Canceling a Request

func doNotHandle()

Indicates the request wasn’t handled.

func cancel()

Cancels the request, for example, because the user taps a cancel button.


Inherits From

Conforms To

See Also

Starting or Canceling a Request

func beginAuthorization(with: ASAuthorizationProviderExtensionAuthorizationRequest)

Tells your request handler to authorize the given request.


func cancelAuthorization(with: ASAuthorizationProviderExtensionAuthorizationRequest)

Tells your request handler to cancel the authorization of the given request.


Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software