コード例 #1
0
        internal Silanis.ESL.API.Auth ToAPIAuthentication()
        {
            if (sdkAuth == null)
            {
                return apiAuth;
            }

            Silanis.ESL.API.Auth auth = new Silanis.ESL.API.Auth();

            auth.Scheme = new AuthenticationMethodConverter(sdkAuth.Method).ToAPIAuthMethod();

            foreach (Challenge challenge in sdkAuth.Challenges)
            {
                Silanis.ESL.API.AuthChallenge authChallenge = new Silanis.ESL.API.AuthChallenge();

                authChallenge.Question = challenge.Question;
                authChallenge.Answer = challenge.Answer;
                authChallenge.MaskInput = challenge.MaskOption == Challenge.MaskOptions.MaskInput;
                auth.AddChallenge(authChallenge);
            }

            if (!String.IsNullOrEmpty(sdkAuth.PhoneNumber))
            {
                Silanis.ESL.API.AuthChallenge challenge = new Silanis.ESL.API.AuthChallenge();

                challenge.Question = sdkAuth.PhoneNumber;
                auth.AddChallenge(challenge);
            }

            return auth;
        }
コード例 #2
0
        internal Silanis.ESL.API.Auth ToAPIAuthentication()
        {
            if (sdkAuth == null)
            {
                return(apiAuth);
            }

            Silanis.ESL.API.Auth auth = new Silanis.ESL.API.Auth();

            auth.Scheme = new AuthenticationMethodConverter(sdkAuth.Method).ToAPIAuthMethod();

            foreach (Challenge challenge in sdkAuth.Challenges)
            {
                Silanis.ESL.API.AuthChallenge authChallenge = new Silanis.ESL.API.AuthChallenge();

                authChallenge.Question  = challenge.Question;
                authChallenge.Answer    = challenge.Answer;
                authChallenge.MaskInput = challenge.MaskOption == Challenge.MaskOptions.MaskInput;
                auth.AddChallenge(authChallenge);
            }

            if (!String.IsNullOrEmpty(sdkAuth.PhoneNumber))
            {
                Silanis.ESL.API.AuthChallenge challenge = new Silanis.ESL.API.AuthChallenge();

                challenge.Question = sdkAuth.PhoneNumber;
                auth.AddChallenge(challenge);
            }

            return(auth);
        }
コード例 #3
0
ファイル: Auth.cs プロジェクト: vtcharlie/esl.sdk.net
        public Auth AddChallenge(AuthChallenge value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("Argument cannot be null");
            }

            _challenges.Add(value);
            return(this);
        }
コード例 #4
0
ファイル: GuestAuth.cs プロジェクト: vtcharlie/esl.sdk.net
     public GuestAuth AddChallenge(AuthChallenge value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("Argument cannot be null");
     }
     
     _challenges.Add(value);
     return this;
 }