Forum

Browse topics, discover Works With Legrand community!

Authorization string OAuth 2.0 ?

Hello,

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

thanks

Hello Nicolas,

You can follow the Step 2 of this tutorial : https://developer.legrand.com/tutorials/0auth2-end-point-url/

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.
Cheers.

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”
}

Thanks.

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

App

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 !

https://www.dropbox.com/s/coywy5qhxnw96o2/Immagine.png?dl=0

  • This reply was modified 5 years, 3 months ago by Riodda. 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 https://partners-login.eliotbylegrand.com/authorize?client_id=XYZ&response_type=code&redirect_uri=msal743094aa-3f8d-4c33-9abd-926de326bcaf://auth
[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 "https://partners-login.eliotbylegrand.com/authorize?client_id=XYZ&response_type=code&redirect_uri=msal743094aa-3f8d-4c33-9abd-926de326bcaf://auth"

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.

https://login.eliotbylegrand.com/redirect_uri/B2C_1_ThirdApp-AccountLinking/api/CombinedSigninAndSignup/confirmed?csrf_token=LONGTOKENThirdApp-AccountLinking&diags=%7B%22pageViewId%22%3A%22fd5d0d46-f184-4288-8f2c-17cb5c730f82%22%2C%22pageId%22%3A%22CombinedSigninAndSignup%22%2C%22trace%22%3A%5B%7B%22ac%22%3A%22T005%22%2C%22acST%22%3A1547018947%2C%22acD%22%3A3%7D%2C%7B%22ac%22%3A%22T021%20-%20URL%3Ahttps%3A%2F%2Feliotuamuistorage.blob.core.windows.net%2Fuam-thirdapp-ui%2Fsignin.html%3Fui_locales%3Dit%22%2C%22acST%22%3A1547018947%2C%22acD%22%3A26%7D%2C%7B%22ac%22%3A%22T004%22%2C%22acST%22%3A1547018948%2C%22acD%22%3A4%7D%2C%7B%22ac%22%3A%22T019%22%2C%22acST%22%3A1547018948%2C%22acD%22%3A12%7D%2C%7B%22ac%22%3A%22T003%22%2C%22acST%22%3A1547018948%2C%22acD%22%3A5%7D%2C%7B%22ac%22%3A%22T002%22%2C%22acST%22%3A0%2C%22acD%22%3A0%7D%5D%7D

  • This reply was modified 5 years, 3 months ago by Riodda. 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 "https://partners-login.eliotbylegrand.com/authorize?client_id=d6f3606b-c2fe-4376-a6dd-dd929cbde18d&response_type=code&redirect_uri=msald6f3606b-c2fe-4376-a6dd-dd929cbde18d://auth"

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 21 total)

You must be logged in to reply to this topic.