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;
        }
Esempio n. 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);
        }
Esempio n. 3
0
        public Auth AddChallenge(AuthChallenge value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("Argument cannot be null");
            }

            _challenges.Add(value);
            return(this);
        }
Esempio n. 4
0
     public GuestAuth AddChallenge(AuthChallenge value)
 {
     if (value == null)
     {
         throw new ArgumentNullException("Argument cannot be null");
     }
     
     _challenges.Add(value);
     return this;
 }