Thursday, 15 July 2010

CORS and ServiceStack Back End for Internal Web Apps -


All,

We use all our internal and backend APIs as a service stack Are trying. Front-facing sites, but we are having problems with problems here ...

Sites

  - site1.xyz.com - site2.xyx.com - etcxyx.com API - api.xyx.com   

1) We need a custom request header to handle authentication. An app on the API server to authenticate our apps app. IDs are sent, so JSONP is out.

2) Since JSON is out, we have to support the optimization. I have to work on Chrome and IE, but IE is throwing this very synergy popup. We can solve it with our internal users, but not with our external users.

If anyone has any suggestions on how to do this, I would love to hear them. I want to hell the COs device to control subdomains. If this happens, it will work and become sick ...

I use CORS I'm new to, but I worked with this option. Public Class YourService: Service {... /// & lt; Summary & gt; /// Correspondence support /// & lt; / Summary & gt; /// & lt; Param name = "request" & gt; & Lt; / Param & gt; /// & lt; Returns & gt; & Lt; / Returns & gt; Public Object Object (YourRequestDto Request) {// Return HTTP Code and Location: Header for New Resource // 204 No Content; The request was successfully processed, but no response body is needed. Return to new HTTPResult () {status code = HTTTPTAS code. Any content, header = {{"access-control-permission-origin", "*"}, {"access-control-permission-methods", "GET, OPTIONS "}, {" access-control-app-headers "," content-type "},}}; }}

My reference was:

The web browser should request an option, should be handled there. After that, create GET, post, etc.

This example allows all domains (*), but you can add your own logic to suit.

FYI- I do not think IE has full corus support till IE 10.

No comments:

Post a Comment