Forum Discussion

ratnesh's avatar
ratnesh
Lithium Alumni (Retired)
12 years ago

Access to community from other domain

Hi,

 I have got an access to the community on one of our stage environment from other domain (e.g. dev.mydomain.com).

 

 

I am wondering, what it means as an access given from other domain technically? Would it be a CORS (Cross Origin Resource Sharing) configuration ? I am trying to access the community data using REST API (using Ajax ) from the other domain but it does not seem to work.

 

Any details on how can I test will be much appreciated.

 

Thanks,

Ratnesh

  • Hey Ratnesh,

    We implemented the change, and it looks to be working now. I get an alert that the response is received and an object is outputted to the screen.

    Yuri
  • Excellent .. I see it is working. Thanks so much for the coordination and the work.
  • Unfortunately I can't access the partner discussion topic you linked :(

    Enabling troubleshooting mode now :)
    What does your REST API call return?
    What call are you issuing and what return do you expect?
    • ratnesh's avatar
      ratnesh
      Lithium Alumni (Retired)

      Hi,

       I have coiped the 6 points that were put in the partner discussion. On this , I had a reply to raise the Support Ticket to enable the cross domain access.

       

       

      1. One of the challenges is the widget would be on their own website(other domain for example  - login.mydomain.com)
      2. Since this poses a cross domain limitation(Same Origin policy of browser) leading to I can not use JavaScript and Ajax to request data from lithium domain.
      3. During my discussion on the lithosphere developer forum, I could come across a point that Lithium does allow the cross domain requests for specific domains.
      4. So was curious to know if I provide the customer's domain and sub domain details, would you be able allow the requests from that domain ?
      5. Also was curiuos know how that would be done and how can I do a small POC(proof of concept) to let the customer know that this approach is going to work like it would be a CORS configuration etc ...
      6. Appreciate if you can share the details on it.

       

      Now,

      To answer your quesries,

       To test the access, I have just written an ajax call (GET) using REST API  to fetch the labels of the board and diaplying them on success. Please see the image below, the errorI receive

       

       

       

       

      hope this clarifies my problem.... Please let me know if you need other details

       

       

      Thanks,

      Ratnesh


      error.JPG
      • VenkS's avatar
        VenkS
        Lithium Alumni (Retired)

        This is not related, but I would recommend using the following to get a JSON response (instead of ?xslt=json.xsl):

         

        ?restapi.response_format=json