Protocols

The following protocols are available globally.

  • Representation of an authenticated account in the Microsoft identity platform. Use MSALAccount to query information about the account, like username or id_token claims. Store identifier for getting tokens silently from MSAL at a later point.

    Note

    For a list of standard id_token claims in the Microsoft Identity platform, see https://docs.microsoft.com/en-us/azure/active-directory/develop/id-tokens
    See more

    Declaration

    Objective-C

    @protocol MSALAccount <NSObject>

    Swift

    protocol MSALAccountProtocol : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Objective-C

    @protocol MSALAuthenticationSchemeProtocol <NSObject>
    
    @property (nonatomic, readonly) MSALAuthScheme scheme;
    
    @property (nonatomic, readonly) NSString *authenticationScheme;
    
    @end

    Swift

    protocol MSALAuthenticationSchemeProtocol : NSObjectProtocol
  • Use this protocol if you have external account storage in addition to MSAL account storage. For example, if you find yourself in situation where on each MSAL completion block invocation you are updating accounts in your own storage, it might be beneficial to instead use MSALExternalAccountProviding extensibility feature.

    See more

    Declaration

    Objective-C

    @protocol MSALExternalAccountProviding <NSObject>

    Swift

    protocol MSALExternalAccountProviding : NSObjectProtocol
  • A protocol that objects adopt to provide deserialization from JSON.

    See more

    Declaration

    Objective-C

    @protocol MSALJsonDeserializable <NSObject>

    Swift

    protocol MSALJsonDeserializable : NSObjectProtocol
  • A protocol that objects adopt to provide serialization to JSON.

    See more

    Declaration

    Objective-C

    @protocol MSALJsonSerializable <NSObject>

    Swift

    protocol MSALJsonSerializable : NSObjectProtocol
  • Class implementing MSALSerializedADALCacheProviderDelegate is responsible for persistence and management of ADAL cache on macOS

    See more

    Declaration

    Objective-C

    @protocol MSALSerializedADALCacheProviderDelegate <NSObject>

    Swift

    protocol MSALSerializedADALCacheProviderDelegate : NSObjectProtocol
  • Undocumented

    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthRequestInterceptor : NSObjectProtocol
  • Protocol that defines the methods of a Credentials delegate

    See more

    Declaration

    Swift

    @objc
    public protocol CredentialsDelegate
  • Undocumented

    See more

    Declaration

    Swift

    @objc
    public protocol RegisterStrongAuthChallengeDelegate
  • Undocumented

    See more

    Declaration

    Swift

    @objc
    public protocol RegisterStrongAuthSubmitChallengeDelegate
  • Protocol that defines the methods of a MFARequestChallenge delegate

    See more

    Declaration

    Swift

    @objc
    public protocol MFARequestChallengeDelegate
  • Protocol that defines the methods of a MFAGetAuthMethodsDelegate delegate

    See more

    Declaration

    Swift

    @objc
    public protocol MFASubmitChallengeDelegate
  • Protocol that defines the methods of a ResetPasswordStart delegate

    See more

    Declaration

    Swift

    @objc
    public protocol ResetPasswordStartDelegate
  • Protocol that defines the methods of a ResetPasswordVerifyCode delegate

    See more

    Declaration

    Swift

    @objc
    public protocol ResetPasswordVerifyCodeDelegate
  • Protocol that defines the methods of a ResetPasswordResendCode delegate

    See more

    Declaration

    Swift

    @objc
    public protocol ResetPasswordResendCodeDelegate
  • Protocol that defines the methods of a ResetPasswordRequired delegate

    See more

    Declaration

    Swift

    @objc
    public protocol ResetPasswordRequiredDelegate
  • Protocol that defines the methods of a SignInAfterResetPassword delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignInAfterResetPasswordDelegate
  • Protocol that defines the methods of a SignInAfterSignUp delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignInAfterSignUpDelegate
  • Protocol that defines the methods of a SignInStart delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignInStartDelegate
  • Protocol that defines the methods of a SignInPasswordRequired delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignInPasswordRequiredDelegate
  • Protocol that defines the methods of a SignInResendCode delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignInResendCodeDelegate
  • Protocol that defines the methods of a SignInVerifyCode delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignInVerifyCodeDelegate
  • Protocol that defines the methods of a SignUpStart delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignUpStartDelegate
  • Protocol that defines the methods of a SignUpVerifyCode delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignUpVerifyCodeDelegate
  • Protocol that defines the methods of a SignUpResendCode delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignUpResendCodeDelegate
  • Protocol that defines the methods of a SignUpPasswordRequired delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignUpPasswordRequiredDelegate
  • Protocol that defines the methods of a SignUpAttributesRequired delegate

    See more

    Declaration

    Swift

    @objc
    public protocol SignUpAttributesRequiredDelegate
  • Shared base delegate for all Native Auth V2 (server-driven) flows.

    Unlike V1 - which exposes a different delegate protocol per step - V2 uses one family of delegates for sign up, sign in and reset password. The SDK drives the flow and reports back through these callbacks; the app reacts and continues the flow by calling methods directly on the MSALNativeAuthState it is handed.

    This base protocol declares only the two terminal callbacks (onFlowCompleted(result:scenario:) and onFlowError(error:scenario:)) that every flow reports. Each server-driven state is delivered through its own per-state delegate protocol (e.g. MSALNativeAuthCodeRequiredDelegate) that extends this base and adds a single strongly-typed, required callback. The app conforms to the per-state protocols for the states it wants to handle; if it does not conform to a state’s protocol, onFlowError(error:scenario:) is called with error type notImplemented.

    All callbacks are invoked on the main actor.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthAttributesInvalidState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthAttributesInvalidDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthAttributesRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthAttributesRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthCodeRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthCodeRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthMFARequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthMFARequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthMFAVerificationRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthMFAVerificationRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthNewPasswordRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthNewPasswordRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthPasswordRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthPasswordRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthSignInAfterResetPasswordState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthSignInAfterResetPasswordRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthStrongAuthRegistrationRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthStrongAuthRegistrationRequiredDelegate : MSALNativeAuthFlowDelegate
  • Per-state delegate for the MSALNativeAuthStrongAuthVerificationRequiredState step of a Native Auth V2 flow.

    Conform to this protocol (in addition to the terminal callbacks inherited from MSALNativeAuthFlowDelegate) to handle this state. Conforming is opt-in per state, but the callback is required once you conform.

    Warning

    This API is experimental. It may be changed in the future without notice. Do not use in production applications.
    See more

    Declaration

    Swift

    @objc
    public protocol MSALNativeAuthStrongAuthVerificationRequiredDelegate : MSALNativeAuthFlowDelegate