public IWebServiceConnection Build() { IAuthenticationTokenService authService = new AuthenticationTokenService() { Url = AuthenticationServiceUrl }; AuthenticationStrategy strategy; switch( m_authStrategyType ) { case AuthenticationStrategyType.Conservative: strategy = new ConservativeStrategy( authService, CredentialSource, m_authTokenType ); break; case AuthenticationStrategyType.SettingsBased: strategy = new SettingsBasedStrategy( authService, CredentialSource, m_authTokenType ); break; case AuthenticationStrategyType.Optimistic: strategy = new OptimisticStrategy( authService, CredentialSource, m_authTokenType ); break; case AuthenticationStrategyType.Reauthenticating: strategy = new ReauthenticatingStrategy( authService, CredentialSource, m_authTokenType ); break; default: strategy = new ReauthenticatingStrategy( authService, CredentialSource, m_authTokenType ); break; } return strategy; }
public AuthenticationServiceStub CreateAuthenticationServiceStub() { AuthenticationTokenService service = new AuthenticationTokenService() { Url = Settings.AuthenticationServiceUrl, Timeout = Settings.Timeout }; return new AuthenticationServiceStub( service ); }