コード例 #1
0
        private SFRestRequest BuildAuthenticatorRestRequest()
        {
            var fedUrl = session.BuildUri(RestPath.SF_AUTHENTICATOR_REQUEST_PATH);
            var data   = new AuthenticatorRequestData()
            {
                AccountName   = session.properties[SFSessionProperty.ACCOUNT],
                Authenticator = oktaUrl.ToString(),
            };

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

            return(session.BuildTimeoutRestRequest(fedUrl, new AuthenticatorRequest()
            {
                Data = data
            }));
        }
コード例 #2
0
        /// <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
            }));
        }
コード例 #3
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
            }));
        }