/// <summary> /// Handler for login request /// </summary> public override TDSMessageCollection OnPreLoginRequest(ITDSServerSession session, TDSMessage request) { // Get the collection from a valid On PreLogin Request TDSMessageCollection preLoginCollection = base.OnPreLoginRequest(session, request); // Check if arguments are of the Federated Authentication server if (Arguments is FederatedAuthenticationNegativeTDSServerArguments) { // Cast to federated authentication server arguments FederatedAuthenticationNegativeTDSServerArguments ServerArguments = Arguments as FederatedAuthenticationNegativeTDSServerArguments; // Find the is token carrying on TDSPreLoginToken TDSPreLoginToken preLoginToken = preLoginCollection.Find(message => message.Exists(packetToken => packetToken is TDSPreLoginToken)). Find(packetToken => packetToken is TDSPreLoginToken) as TDSPreLoginToken; switch (ServerArguments.Scenario) { case FederatedAuthenticationNegativeTDSScenarioType.NonceMissingInFedAuthPreLogin: { // If we have the prelogin token if (preLoginToken != null && preLoginToken.Nonce != null) { // Nullify the nonce from the Token preLoginToken.Nonce = null; } break; } case FederatedAuthenticationNegativeTDSScenarioType.InvalidB_FEDAUTHREQUIREDResponse: { // If we have the prelogin token if (preLoginToken != null) { // Set an illegal value for B_FEDAUTHREQURED preLoginToken.FedAuthRequired = TdsPreLoginFedAuthRequiredOption.Illegal; } break; } } } // Return the collection return(preLoginCollection); }
private TDSFeatureExtAckToken GetFeatureExtAckTokenFromLogin7(TDSMessageCollection login7Collection) { // Find the is token carrying on TDSFeatureExtAckToken return(login7Collection.Find(m => m.Exists(p => p is TDSFeatureExtAckToken)). Find(t => t is TDSFeatureExtAckToken) as TDSFeatureExtAckToken); }
private TDSFeatureExtAckToken GetFeatureExtAckTokenFromLogin7(TDSMessageCollection login7Collection) { // Find the is token carrying on TDSFeatureExtAckToken return login7Collection.Find(m => m.Exists(p => p is TDSFeatureExtAckToken)). Find(t => t is TDSFeatureExtAckToken) as TDSFeatureExtAckToken; }