Forum

Browse topics, discover Works With Legrand community!

setting redirect uri to localhost – how to?

Is it possible to set the redirect_uri to point to a local page?

This is the jsp page:

<script>
var authorize = {
“url”: “https://partners-login.eliotbylegrand.com/authorize?client_id=af993c3a-xxxx-yyyy-zzzz-3bb9e2d83298&response_type=code&redirect_uri=https://localhost/HomePlus/authorize.jsp“,
“method”: “GET”,
“timeout”: 0,
};

$.ajax(authorize).done(function (response) {
console.log(response);
});
</script>

I receive an error:

denied by Cross-Origin Resource Sharing policy: Origin https://10.0.1.101 is not allowed by Access-Control-Allow-Origin.

Webpage is hosted on a headless device. Webpage is accessed from browser pointing to DEVICE_IP/… in the LAN. It’s not possible to define the IP address as the uri since the device has (most likely) a different IP in each project.

Oh, to confirm, the uri is indeed also set as a valid url in the application settings:

Third Reply Url
https://localhost/HomePlus/authorize.jsp

Hello Pascal,

We scheduled to allow CORS policy for our APIs at the end of next week

Could we get in touch with you next week in order you to test it and validate if it works ?

Have a good day,

Leslie – Community Manager

Hi Leslie,

Sure you can.

For now i added the procedure on our dealersite so the uri is not pointing to a ‘localhost’ device anymore. I’m using the “state” parameter as a reference to store the returned code encrypted on a DB. Headless device grabs that code from DB and deletes it as a workarround.

Regards, Pascal

Hi Leslie,

Sure you can.

For now i added the procedure on our dealersite so the uri is not pointing to a ‘localhost’ device anymore. I’m using the “state” parameter as a reference to store the returned code encrypted on a DB. Headless device grabs that code from DB and deletes it as a workarround.

Regards, Pascal

Hello Pascal,

CORS policies are now enabled

Can you please tell me if it resolved your issue ?

Thanks and have a good day,

Leslie – Community Manager

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Information

watch_later 3 weeks, 1 day ago
message5 replies
people2 participants