2010-08-04 6 views
0

asp.net + MVC1.0을 사용하고 웹 페이지에서 각 폼 내에 다음 함수 AntiForgeryToken()을 호출하여 숨겨진 값을 생성했습니다. Controller 함수에는 validate 특성이 있습니다.Base-64 문자 배열에 대한 길이가 잘못되었습니다.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.FormatException: Invalid length for a Base-64 char array. 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082 

[FormatException]: Invalid length for a Base-64 char array. 
    at System.Convert.FromBase64String(String s) 
    at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) 
    at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) 
    at System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) 
[HttpAntiForgeryException]: A required anti-forgery token was not supplied or was invalid. 
    at System.Web.Mvc.AntiForgeryDataSerializer.Deserialize(String serializedToken) 
    at System.Web.Mvc.ValidateAntiForgeryTokenAttribute.OnAuthorization(AuthorizationContext filterContext) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeAuthorizationFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor) 
    at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) 
    at System.Web.Mvc.Controller.ExecuteCore() 
    at System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) 
    at System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) 
    at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) 
    at System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) 
    at System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) 
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) 

This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using <customErrors mode="Off"/>. Consider using <customErrors mode="On"/> or <customErrors mode="RemoteOnly"/> in production environments. 

그리고이 캡처 된 토큰이 정확히 확신 : 나는 JMeter를 사용하고 다음 서버에 내 양식 토큰을 게시 정규 표현식을 사용하여 토큰을 캡처 할 때

, 나는이 같은 예외를 throw 발견 우리가 생성 한 것과 같은, 왜이 예외가 일어 났는가?

+0

실제로 Base-64 문자열을 인쇄 할 수 있습니까? 그것의 정확 여부를 확인하기 위해 상당히 간단합니다. – Akusete

답변

1

서버에 게시하기 전에 토큰을 인코딩하지 않았기 때문에 그냥 해결되었습니다.

관련 문제