/// <summary>
        /// Builds a simple login request. Each authenticator will fill the Data part with their
        /// specialized information. The common Data attributes are already filled (clientAppId,
        /// ClienAppVersion...).
        /// </summary>
        /// <returns>A login request to send to the server.</returns>
        private SFRestRequest BuildLoginRequest()
        {
            // build uri
            var loginUrl = session.BuildLoginUrl();

            LoginRequestData data = new LoginRequestData()
            {
                loginName         = session.properties[SFSessionProperty.USER],
                accountName       = session.properties[SFSessionProperty.ACCOUNT],
                clientAppId       = SFEnvironment.DriverName,
                clientAppVersion  = SFEnvironment.DriverVersion,
                clientEnv         = SFEnvironment.ClientEnv,
                SessionParameters = session.ParameterMap,
                Authenticator     = authName,
            };

            SetSpecializedAuthenticatorData(ref data);

            int connectionTimeoutSec = int.Parse(session.properties[SFSessionProperty.CONNECTION_TIMEOUT]);

            return(session.BuildTimeoutRestRequest(loginUrl, new LoginRequest()
            {
                data = data
            }));
        }
Ejemplo n.º 2
0
        private SFRestRequest BuildLoginRequest()
        {
            // build uri
            var loginUrl = session.BuildLoginUrl();

            LoginRequestData data = new LoginRequestData()
            {
                loginName        = session.properties[SFSessionProperty.USER],
                password         = session.properties[SFSessionProperty.PASSWORD],
                accountName      = session.properties[SFSessionProperty.ACCOUNT],
                clientAppId      = ".NET",
                clientAppVersion = SFEnvironment.Version,
                clientEnv        = SFEnvironment.ClientEnv,
            };

            int connectionTimeoutSec = int.Parse(session.properties[SFSessionProperty.CONNECTION_TIMEOUT]);

            return(session.BuildTimeoutRestRequest(loginUrl, new LoginRequest()
            {
                data = data
            }));
        }
        private SFRestRequest BuildExternalBrowserLoginRequest(string token, string proofKey)
        {
            // build uri
            var loginUrl = session.BuildLoginUrl();

            LoginRequestData data = new LoginRequestData()
            {
                loginName        = session.properties[SFSessionProperty.USER],
                clientAppId      = ".NET",
                clientAppVersion = SFEnvironment.Version,
                clientEnv        = SFEnvironment.ClientEnv,
                Token            = token,
                ProofKey         = proofKey,
                Authenticator    = AUTH_NAME,
            };

            int connectionTimeoutSec = int.Parse(session.properties[SFSessionProperty.CONNECTION_TIMEOUT]);

            return(session.BuildTimeoutRestRequest(loginUrl, new LoginRequest()
            {
                data = data
            }));
        }
        private SFRestRequest BuildOktaLoginRestRequest(string samlRawHtmlString)
        {
            // build uri
            var loginUrl = session.BuildLoginUrl();

            LoginRequestData data = new LoginRequestData()
            {
                loginName         = session.properties[SFSessionProperty.USER],
                password          = session.properties[SFSessionProperty.PASSWORD],
                accountName       = session.properties[SFSessionProperty.ACCOUNT],
                clientAppId       = SFEnvironment.DriverName,
                clientAppVersion  = SFEnvironment.DriverVersion,
                clientEnv         = SFEnvironment.ClientEnv,
                RawSamlResponse   = samlRawHtmlString,
                SessionParameters = session.ParameterMap,
            };

            int connectionTimeoutSec = int.Parse(session.properties[SFSessionProperty.CONNECTION_TIMEOUT]);

            return(session.BuildTimeoutRestRequest(loginUrl, new LoginRequest()
            {
                data = data
            }));
        }