コード例 #1
0
        public async Task <ProviderResult> Login(ISecurityCheckDelegate checkDelegate, string scopeSecurity, JObject challengeRequest)
        {
            ProviderResult result = new ProviderResult();

            this.SecurityChallenge = new SecurityChallengeHandler(scopeSecurity, challengeRequest);
            this.SecurityChallenge.eventSuccessHandler += checkDelegate.AuthenticationSucessEventHandle;
            this.SecurityChallenge.eventHandleFailure  += checkDelegate.AuthenticationFailureEventHandle;

            this.SecurityChallenge.ShouldCancel();
            this.client.RegisterChallengeHandler(this.SecurityChallenge);
            this.client.AuthorizationManager.SetLoginTimeOut(this.Timeout);

            try
            {
                await MobileFirstHelper.Instance.GetSemaphore().WaitAsync();
            }
            catch (ObjectDisposedException)
            {
                MobileFirstHelper.Instance.DisponseSemaphore();
                await MobileFirstHelper.Instance.GetSemaphore().WaitAsync();
            }

            var resultChallenge = await this.client.AuthorizationManager.Login(scopeSecurity, challengeRequest);

            result.Success    = resultChallenge.Success;
            result.Message    = resultChallenge.Message;
            result.CodeStatus = resultChallenge.HTTPStatus;
            result.Response   = JsonConvert.SerializeObject(resultChallenge.ResponseJSON);

            MobileFirstHelper.Instance.GetSemaphore().Release();

            return(result);
        }
コード例 #2
0
 public Task <ProviderResult> Login(ISecurityCheckDelegate checkDelegate, string scopeSecurity, JObject challengeRequest)
 {
     throw new NotImplementedException();
 }