internal OneSpanSign.API.Auth ToAPIAuthentication()
        {
            if (sdkAuth == null)
            {
                return(apiAuth);
            }

            OneSpanSign.API.Auth auth = new OneSpanSign.API.Auth();

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

            foreach (Challenge challenge in sdkAuth.Challenges)
            {
                OneSpanSign.API.AuthChallenge authChallenge = new OneSpanSign.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))
            {
                OneSpanSign.API.AuthChallenge challenge = new OneSpanSign.API.AuthChallenge();

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

            return(auth);
        }
Beispiel #2
0
        public GuestAuth AddChallenge(AuthChallenge value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("Argument cannot be null");
            }

            _challenges.Add(value);
            return(this);
        }