Browse topics, discover Works With Legrand community!

Authorization string OAuth 2.0 ?


I would like to know how I can get the Authorization string OAuth 2.0 access token to try Home + Control API function, please ?


Hello Nicolas,

You can follow the Step 2 of this tutorial :

Have a good day,
Leslie – Community Manager

Hi Leslie, i have created an app so i don’t have a redirect redirect_uri this stops all the procedure.

Hello Dario,

Defining a redirect_uri is mandatory in order to create an application with the Oauth2 authentification process. Your users will be redirected there after their authentification.
If you have already created your application, you defined the redirect_uri when you followed the steps at the creation.

Have a nice day,
Leslie – Community Mananger

Hi Leslie, what you say is true for the creation of a Web application, but when from Application Type you choose App instead of Web the application the redirect_uri fiels disappers and you get a code like urn:ietf:wg:oauth:2.0:oob then a first reply url and a second replay url.

If i use any of those i have an aswer like

“error”: “invalid_request”,
“error_description”: “The request does not contain a redirectUrl parameter”


Can you send me a screenshot of the configuration of your application ? (if there is personal information don’t forget to hide them)

Leslie – Community Manager


The forum didn’t even allow to store a picture in the discussion, seems that Legrand didn’t put that much effort in this thing, it reminds me a 90′ forum with url for the pictures ! LOL !

  • This reply was modified 8 months, 3 weeks ago by  Dario Armellin. Reason: img link don't seem to work

Hello Dario,

Adding images directly on the forum is a new feature coming in a few days ;).

To answer your question :
Maybe I don’t see it well, but it seems you add a “/” after the “msal” in the second reply URL.
According to what I understood, the correct scheme should be like this example : msal3dd71888-ap59-44fa-b496-d8f82169e7xk://auth

If the issue comes from the “/”, try to edit your application and tell me if it worked!

Have a good day,
Leslie – Community Manager

Hi Leaslie, i haven’t added anything to the second reply url, the command i issue is

dario@debian:~$ curl
[1] 6275
[2] 6276
dario@debian:~$ {
“error”: “invalid_request”,
“error_description”: “The request does not contain a redirectUrl parameter”

Hello Dario,

Maybe it will help you :
If I put the URL between quotes with a command (-v, -L, …) I seem to retrieve some datas.

For example : curl -v ""

Have a good day,
Leslie – Community Manager

Thanks Leslie, the quotes seems to have worked out to get the GET request but I receive a web page with a login form instead of a code that i need to request the access token, if i make the get request in a browser instead of using curl and then i complete the login in the response url i don’t get any code, many thanks.

  • This reply was modified 8 months, 2 weeks ago by  Dario Armellin. Reason: update

Hello Dario,

When I am on the white page in the browser after I logged in, if I display the source code I have “code” with its value.
Maybe you can try it.

Have a good day,
Leslie – Community Manager

Ahhh i got it finally, i have enjoyed the tresure hunt for the code, i would suggest to document this procedure a bit better !
Many thanks for your help.

I have been struggling with the same things and this thread really helped. However, when I run the curl command for my application I am unable to find “code” in the source for the page.

curl -v ""

There is a message about the redirect uri not being associated with the app_id, but do you think you could give me a little more direction as to why mine is failing? I can get screenshots or more info if you need it, just let me know what you need.

there now way i found to script the code retrival, when you invoke the autorize endpoint the you have to manually login then you find blank page with the code, but lookslike you have to do it only once but i will tell for sure in 90 days.

Viewing 15 posts - 1 through 15 (of 19 total)

You must be logged in to reply to this topic.


message18 replies
people5 participants