/// <summary> /// Set's a delegate that the authorization controller informs about the success or failure of an authorization attempt. /// </summary> /// <param name="delegate">A delegate that the authorization controller informs about the success or failure of an authorization attempt.</param> public void SetDelegate(ISN_IASAuthorizationControllerDelegate @delegate) { ISN_AuthenticationServicesLib._ISN_ASAuthorizationController_setDelegate( NativeHashCode, ISN_MonoPCallback.ActionToIntPtr <SA_Error>(@delegate.DidCompleteWithError), ISN_MonoPCallback.ActionToIntPtr <ISN_ASAuthorizationAppleIDCredential>(@delegate.DidCompleteWithAuthorization)); }
/// <summary> /// Creates a controller from a collection of authorization requests. /// </summary> /// <param name="authorizationRequests">One or more authorization requests that this controller can perform.</param> public ISN_ASAuthorizationController(IEnumerable <ISN_ASAuthorizationRequest> authorizationRequests) { var requestsString = string.Join(",", authorizationRequests .Select(request => request.NativeHashCode.ToString()).ToArray()); NativeHashCode = ISN_AuthenticationServicesLib._ISN_ASAuthorizationController_initWithAuthorizationRequests(requestsString); }
/// <summary> /// The contact information to be requested from the user during authentication. /// </summary> /// <param name="scopes">Authorization Scopes list</param> public void SetRequestedScopes(IEnumerable <ISN_ASAuthorizationScope> scopes) { var scopesString = string.Join(",", scopes.Select(scope => scope.ToString()).ToArray()); ISN_AuthenticationServicesLib._ISN_ASAuthorizationOpenIDRequest_setRequestedScopes(NativeHashCode, scopesString); }
/// <summary> /// Creates a new Apple ID authorization request. /// </summary> /// <returns>An Apple ID authorization request that you can configure and execute.</returns> public ISN_IASAuthorizationAppleIDRequest CreateRequest() { var requestHash = ISN_AuthenticationServicesLib._ISN_ASAuthorizationAppleIDProvider_createRequest(NativeHashCode); return(new ISN_ASAuthorizationSingleSignOnRequest(requestHash)); }
public ISN_ASAuthorizationAppleIDProvider() : base(ISN_AuthenticationServicesLib._ISN_ASAuthorizationAppleIDProvider_init()) { }
/// <summary> /// Starts the authorization flows named during controller initialization. /// /// When authorization succeeds, the system tells the controller’s delegate /// by calling the <see cref="ISN_IASAuthorizationControllerDelegate.DidCompleteWithAuthorization"/> method with an authorization instance. /// If authorization fails, the system calls the <see cref="ISN_IASAuthorizationControllerDelegate.DidCompleteWithError"/> method instead. /// /// Some authorization flows require a presentation context to ask the user for information or consent. /// </summary> public void PerformRequests() { ISN_AuthenticationServicesLib._ISN_ASAuthorizationController_performRequests(NativeHashCode); }