예제 #1
0
 /// <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));
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
        /// <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));
        }
예제 #5
0
 public ISN_ASAuthorizationAppleIDProvider()
     : base(ISN_AuthenticationServicesLib._ISN_ASAuthorizationAppleIDProvider_init())
 {
 }
예제 #6
0
 /// <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);
 }