Forum Discussion

sullysnack's avatar
sullysnack
Khoros Alumni (Retired)
7 years ago

Admin -> System -> HTTP Client, Lithium's API proxy domains not allowed

I'm interested in making API calls to the Lithium API proxies from an endpoint, using http.client. However, in Admin -> System -> HTTP Client, the Allowed domain names field won't let me set the Lithium API proxies as allowed domain names. On our stage instance it won't let me set:
api.stage.lithium.com
and on production it won't let me set:
api.lithium.com

Can we request a special configuration which allows the API proxy domains? Or is there another work around available?

 

  • Parshant's avatar
    Parshant
    7 years ago

    sullysnack,

    In this case you need to contact with support@lithium.com for additional help into this issue.

  • peterlu's avatar
    peterlu
    7 years ago

    sullysnack Lithium does not allow it for some reason. Please try with Support and hope you can push the door open and let us know.

9 Replies

  • sullysnack,

    You can add whole url in proxy or you have to add dot(.) before the proxy url.

    Like .lithium.com,.api.lithum.com,api.lithum.com,api.stage.lithium.com

    Do not add space in between the url and comma(,).

  • sullysnack's avatar
    sullysnack
    Khoros Alumni (Retired)
    7 years ago

    I'm looking for more help than that. If you try to add api.lithium.com or api.stage.lithium.com there, you would see this error:

    One or more domains entered is not allowed.

    I'm asking how to work around the error, so that http.client calls to those proxy domains will work.

  • Parshant's avatar
    Parshant
    Boss
    7 years ago

    sullysnack,

    In this case you need to contact with support@lithium.com for additional help into this issue.

  • peterlu's avatar
    peterlu
    Champion
    7 years ago

    sullysnack Lithium does not allow it for some reason. Please try with Support and hope you can push the door open and let us know.

  • This is also an annoying issue for us, we had to create a redirect proxy on an external server (because ONLY domains that do not contain *.lithium.com can be entered into the allowed domain names field in Admin) that would simply forward whatever endpoint-generated request it receives to the Lithium API, like this we could circumvent this (tbh insane) limitation but it's far from reasonable or nice and the reasons behind not allowing the http.client to call the Lithium APIs are unclear to us as well, maybe SuzieH or DougS could give us some insight into that descision?

    The main issue I see with not allowing this is that if we want to implement AJAX enhanced community features, let's say giving a kudo to a post via API v2 (with v1 you can do it as it does not have to be a POST request containing auth related stuff like client-id's) we can choose between using a workaround like described above OR expose our tenant and client-id's to everybody within our Javascript code (where the POST requests would then be issued from), we do not want to expose such information to the public and therefore we went with the redirect-proxy approach.

    The ideal approach (IMHO) would be if we can create an endpoint which is called through AJAX and handles the logic & request-making by receiving simple commands passed trough GET params or other means. The POST/PUT/DELETE requests would then be made from within that endpoint by means of using the http.client...

  • sullysnack's avatar
    sullysnack
    Khoros Alumni (Retired)
    7 years ago

    Hi luk, we contacted Lithium support and they configured an exception on our instances, to allow http.client calls to api.stage.lithium.com and api.lithium.com .

  • luk's avatar
    luk
    Boss
    7 years ago

    sullysnack that's good to know, will try to get that exception as well =), thanks!

  • SuzieH's avatar
    SuzieH
    Khoros Alumni (Retired)
    7 years ago

    luk I'm not sure of the reason for that decision. I'll see if I can track something down, but I suspect that you probably nailed it in your guess. Now I need to figure out whether or not I can document the possibility of Support making an exception ;-)

    I'll try to get down to the bottom of this. Not sure if I can get this bumped up in priority to make it a customer-configurable option. That decision is above my pay scale. 

  • luk's avatar
    luk
    Boss
    7 years ago

    SuzieH thanks for the fast reply. Technically it is already customer-configurable trough the Admin settings for the HTTP client, we can just not enter any URL containing "lithium.com" into that field, so it's some kind of special validation rule that is set up there, wouldn't be a big programming-task to remove that validation IMHO =)