Forum

Browse topics, discover Works With Legrand community!

Cannot login with DoorEntrySDKDemo – internal server error

Dear Legrand-Support,

I started an Android project based on DoorEntrySDKDemo. For a first try, I used the plain DoorEntrySDKDemo. I was able to build and run it with Android-SDK 29.0.3.

I have a normal user account and a legrand-developer account. I also have an approved Legrand-Application which I have connected to my normal user account. If have take a look inside the user account, I can see the approved Application in “third-party access”.

I followed the tutorial: https://developer.legrand.com/tutorials/create-an-application.

Also I added the valid client_id, secret and api_subscription_key to the config.xml, like written in the docu.

Now I try to run the Application on a real device or in the emulator mode, everytime the same result.

I click on “C300X” -> “LOGIN” and insert my legrand-developer credentials. This seems to work. Then I am asked again, to approve the Application I have created. I have approved this several times, but everytime it seems to fail inside the App, although I have it already approved. (I can see it is approved, if I use the official DoorEntry App).

Also I get an internal server error:

03-10 15:08:44.311 6472-6506/com.legrandgroup.doorentry.sdkdemo W/AsyncResourceLoader: loadInBackground thrown error
com.google.api.client.auth.oauth2.TokenResponseException: 500 Internal Server Error
{
"error" : "server_error",
"error_description" : "An unexpected server error occurred"
}
at com.wuman.android.auth.oauth2.explicit.LenientAuthorizationCodeTokenRequest.executeLeniently(LenientAuthorizationCodeTokenRequest.java:180)
at com.wuman.android.auth.oauth2.explicit.LenientAuthorizationCodeTokenRequest.execute(LenientAuthorizationCodeTokenRequest.java:104)
at com.wuman.android.auth.OAuthManager$3.doWork(OAuthManager.java:206)
at com.wuman.android.auth.OAuthManager$BaseFutureTask.startTask(OAuthManager.java:420)
at com.wuman.android.auth.OAuthManager$Future2Task.start(OAuthManager.java:443)
at com.wuman.android.auth.OAuthManager$5.run(OAuthManager.java:399)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
03-10 15:08:44.312 6472-6472/com.legrandgroup.doorentry.sdkdemo D/EliotLoginFragment: Eliot credentials Load finished

A deeper look inside also shows, that the REDIRECT_URL callback is false:

03-10 13:44:50.196 5252-5252/com.legrandgroup.doorentry.sdkdemo I/OAuthAndroid: url: https://login.eliotbylegrand.com/[....]/oauth2/v2.0/authorize?p=B2C_1_ThirdApp-AccountLinking&client_id=[....]&redirect_uri=https%3a%2f%2fpartners-login.eliotbylegrand.com%2fauthentication%2fauthorizecallback&response_type=code+id_token&response_mode=form_post&scope=openId+offline_access+https%3a%2f%2feliotclouduamprd.onmicrosoft.com%2fsecurity%2ftopology.read+https%3a%2f%2feliotclouduamprd.onmicrosoft.com%2fsecurity%2flock.read+https%3a%2f%2feliotclouduamprd.onmicrosoft.com%2fsecurity%2flock.write&state=[....]&x-client-SKU=ID_NETSTANDARD1_4&x-client-ver=5.2.0.0, redirect: https://login.microsoftonline.com/tfp/oauth2/nativeclient, callback: false
03-10 13:44:50.207 5252-5274/com.legrandgroup.doorentry.sdkdemo E/eglCodecCommon: glUtilsParamSize: unknow param 0x000085b5

It makes no difference, if I approve or deny the Application after Login. I get an internal server error, callback: false and get logged out again.

Also a look through the FAQ and this thread hasn’t helped so far:
https://developer.legrand.com/forums/topic/unable-to-get-plantid-with-classe-300x13e-api/
Thanks in Advance.

  • This topic was modified 4 years, 1 month ago by ThorsHamster. Reason: Improved for better readability

Hello,

Here is an answer from the DoorEntry SDK developer team :

I would say there is something wrong in his code (or in his application data) for the following reasons:

– Our demo app is performing login correctly with the code we redistribute and with our third-party demo application data

– The issue is not related to C300X or SDK, but this is a standard login flow for third party app, our demo app is doing sign in as we implemented it, he can do it in same way or different one (he has source code from demo app so he can check)

Then a couple of notes:

– He registered an application with wrong scopes to use C300X: he has selected lock.read and lock.write, but he needs audiovideoterminal scopes (but this is not related to login issue)

– The page to approve third party application will appear at every third party app login, so it’s normal to be requested to approve his app

– It’s also correct that the REDIRECT_URL callback is false

 

Hoping those answer will help you

Have a good day,

Leslie – Community Manager

Hi,

After more investigation I had another feedback. There is an issue on our side concerning the login steps :

  • The first one (credentials) works well
  • But the token retrieval part is broken (for new applications using de DemoApp only)

The teams are working to find the root cause and to correct it

Have a good day,

Leslie – Community Manager

Hello,

Some good news : the issue was just a misconfiguration of your app during the manual validation process

It should work normally now

Have a good day,

Leslie – Community Manager

Dear Leslie,

thank you and your dev team very much for your feedback.

It seems that the missing permissions were the problem. I added all (just to be sure) possible API permission for “my App” on your Legrand developer website. Your dev team said, it should be the missing ‘audiovideoterminal’ scopes.

Now I was able to login successfully with the Demo App.

I could also go on “Proceed” and could see my Plant. Clicking on it went into an error and completely breakdown of the DemoApp, but I think this is a different error. I take a look if I am able to fix this, otherwise I will open a new thread.

Thank you very much for your great and fast support.

Best regards,

ThorsHamster

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

You must be logged in to reply to this topic.