private void Session_UserAuthenticationInformationRequestReceived(object sender, MessageEventArgs<InformationRequestMessage> e)
{
var informationRequestMessage = e.Message;
var eventArgs = new AuthenticationPromptEventArgs(Username,
informationRequestMessage.Instruction,
informationRequestMessage.Language,
informationRequestMessage.Prompts);
ThreadAbstraction.ExecuteThread(() =>
{
try
{
if (AuthenticationPrompt != null)
{
AuthenticationPrompt(this, eventArgs);
}
var informationResponse = new InformationResponseMessage();
foreach (var response in from r in eventArgs.Prompts orderby r.Id ascending select r.Response)
{
informationResponse.Responses.Add(response);
}
// Send information response message
_session.SendMessage(informationResponse);
}
catch (Exception exp)
{
_exception = exp;
_authenticationCompleted.Set();
}
});
}