Hello Jon,
I am getting this same error, did you manage to solve this issue?
Best Regards
Looks like it, yes - CreateValidationToken() method below will return null if user is not authenticated.
httpContext.Response.Headers[aspNetAntiForgery.HeaderName] = aspNetAntiForgery.CreateValidationToken();
I would call this a bug.
Hello Mari,
Thanks for your debugging help, I just registered an "incident". Will follow up in this thread as soon as I get a response back.
Cheers,
Hello,
The response from the EPiServer Support Team:
"Unfortunately you can't use REST data anonymously and if you want to do that, you have to use WebAPI a standard thing from Microsoft."
ASP. NET Web API is pretty straightforward as well, specially if you are already developing a ASP. NET MVC site. If the site is based on WebForms, the following link would help:
http://www.asp.net/web-api/overview/creating-web-apis/using-web-api-with-aspnet-web-forms
If your responses need to be in JSON, one alternative would be the following:
Regards,
Hi,
I am working on EPiserver CMs 7 Rest service as per the article:http://world.episerver.com/Documentation/Items/Developers-Guide/EPiServer-Framework/7/User-Interface/Setting-Up-a-REST-Data-Store/ and http://bergdaniel.se/creating-a-rest-data-store-in-episerver-7-preview.
I am getting an error "value can not be null" when i am anonymous.
Server Error in '/' Application. Value cannot be null.
Parameter name: value 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.ArgumentNullException: Value cannot be null.
Parameter name: value
Source Error:
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. |
Stack Trace:
[ArgumentNullException: Value cannot be null. Parameter name: value] System.Web.HttpHeaderCollection.SetHeader(String name, String value, Boolean replace) +9512466 System.Web.HttpHeaderCollection.Set(String name, String value) +23 EPiServer.Shell.Services.Rest.RestHttpHandler.ValidateAntiForgeryToken(HttpContextBase httpContext) +108 EPiServer.Shell.Services.Rest.RestHttpHandler.ProcessRequest(HttpContextBase httpContext) +81 EPiServer.Shell.Services.Rest.RestHttpHandler.ProcessRequest(HttpContext context) +42 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69 |
Also when accessing the restservice with login the Json response starts with "{}&&" thus making the response data not getting validated.
Can anyone provide any inputs on how to access EPiserver rest service anonymously and how to parse the Json response starting with "{}&&".
Any help will be highly appreciated.
Thanks
Gunjan
Mob:+91-9831027164
The EPiServer REST stores are to be used for user interface functions only and these require that you are authenticated. If you want to use this for the public site, we recommend that you use Web.API instead.
Hi
Does rest stores require that the visitor is authorized?
I get this error when i'm anonymous: