Skip to content

Instantly share code, notes, and snippets.

@bradbrowne
Created January 7, 2017 23:38
Show Gist options
  • Save bradbrowne/580c17c17c4839a80bba9bbedc22a96d to your computer and use it in GitHub Desktop.
Save bradbrowne/580c17c17c4839a80bba9bbedc22a96d to your computer and use it in GitHub Desktop.
public class SampleRequestValidator : RequestValidator
{
protected override bool IsValidRequestString( HttpContext context, string value, RequestValidationSource requestValidationSource, string collectionKey, out int validationFailureIndex )
{
validationFailureIndex = 0;
if ( requestValidationSource == RequestValidationSource.Form
&& collectionKey.Equals( WSFederationConstants.Parameters.Result, StringComparison.Ordinal ) )
{
SignInResponseMessage message = WSFederationMessage.CreateFromFormPost( context.Request ) as SignInResponseMessage;
if ( message != null )
{
return true;
}
}
return base.IsValidRequestString( context, value, requestValidationSource, collectionKey, out validationFailureIndex );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment