Platforms to show: All Mac Windows Linux Cross-Platform

ASAuthorizationControllerMBS class   New in 25.3

Type Topic Plugin Version macOS Windows Linux iOS Targets
class AuthenticationServices MBS MacFrameworks Plugin 25.3 ✅ Yes ❌ No ❌ No ✅ Yes All
A controller that manages authorization requests that a provider creates.
Example
Var provider As New ASAuthorizationAppleIDProviderMBS

// we create the request
var request as ASAuthorizationAppleIDRequestMBS = provider.createRequest

// we ask for email and full name
Var RequestedScopes() As String
RequestedScopes.add ASAuthorizationMBS.ASAuthorizationScopeEmail
RequestedScopes.add ASAuthorizationMBS.ASAuthorizationScopeFullName

request.setRequestedScopes RequestedScopes

// create our controller
controller = New ASAuthorizationController(array(request))

// set context window for dialog
controller.presentationContext = Self

// and show dialog now
controller.performRequests

Create authorization requests for the credential types your app supports, such as ASAuthorizationAppleIDRequest for Sign in with Apple, or ASAuthorizationPasswordRequest for password credentials. Create an authorization controller using Constructor, supplying the authorization requests you create. Implement the authorization controller’s events to receive responses when requests succeed or fail, and set its presentationContextProvider so that the authorization controller can present UI.

Call performAutoFillAssistedRequests to present inline UI to request credentials, or performRequests to request credentials using modal UI. ASAuthorizationController calls your delegate’s methods when the request completes.

Set the content type of text fields in your app’s login UI so that ASAuthorizationController can detect when to offer AutoFill suggestions. Use UITextContentTypeUsername as the content type for user name text fields, and UITextContentTypePassword for password fields.

Constants

Constant Value Description
AuthorizationControllerRequestOptionPreferImmediatelyAvailableCredentials 1 One of the option constants for performRequests. Tells the authorization controller to prefer credentials that are immediately available on the local device.

Errors

Constant Value Description
ErrorCanceled 1001 The user canceled the authorization attempt.
ErrorCredentialExport 1008 The credential export request failed.
ErrorCredentialImport 1007 The credential import request failed.
ErrorFailed 1004 The authorization attempt failed.
ErrorInvalidResponse 1002 The authorization request received an invalid response.
ErrorMatchedExcludedCredential 1006 This error should only be returned when specifying @c excludedCredentials on a public key credential registration request.
ErrorNotHandled 1003 The authorization request wasn’t handled.
ErrorNotInteractive 1005 Not interactive.
ErrorUnknown 1000 The authorization attempt failed for an unknown reason.

This class has no sub classes.

Blog Entries

Release notes

Some related classes:


The items on this page are in the following plugins: MBS MacFrameworks Plugin.


ASAuthorizationAppleIDRequestMBS   -   ASAuthorizationCredentialMBS


The biggest plugin in space...