Issues with oauth callback

I have been working on building a smartthings schema connected cloud service and have bumped into some issues with the oauth flow on the smartthings side.

I have set up an API and machine application (oauth client) in auth0 and have used these details to fill in the required details on the smartthings config side. I’ve enabled developer mode on my smartthings app and can successfully initiate the device connection. I am taken through the beginning of the oauth flow where I log in and then get redirected to the c2c callback endpoint where it fails.

The error I get is “Couldn’t link account.” and an accompanying error code which seems more like a request ID (example: 25IJ24).

I can see that the authorization code is successfully exchanged from the auth0 logs (and the code is present in the query parameters of the callback endpoint) so it seems that something is going wrong in the token creation part. I do not see any failed requests in the auth0 logs.

This is very reproducible for me so if anyone is able to use those error codes to look at something on the smartthings side i’d really appreciate the help.

Please let me know if there are any other questions or info you need. Thanks!

tagging @nayelyz

Hi @joesnell

I will check it, but for more context Did your connector show some errors or logs? or Did the request never arrive?

No there were no requests sent to the connector. The flow consistently fails in the SmartThings app when I am trying to add the device (it fails at the oauth callback).

Mmm, I think the error is between the SmarThings Cloud and your Implementation, please send an email to build@smartthings.com, with the error code.

Did you resolved the issue? I have a similar (same) issue. Can you give me any advice what was wrong in your case?

What I see in my case is that on the SmartThings Redirect URI show 424 HTTP error. My identity provider correctly exchange the code and state values.

image

Hope to hear from you!

Hi, @klucyszy. Welcome to the SmartThings Community!

The screenshot you shared seems to come from a web browser. Are you working with a Cloud Connected device?
If so, how are you calling the integration? The Schema connector should be called from the App because it defines the parameters and object required for these requests.

Yes, my intention is to build C2C integration.
Yes, the screenshot comes from web browser as I run the invitation from my web browser to debug better what happen. I tried also on my mobile phone using the ‘Deploy to Test’ mode and running the integration from my SmartThings app but it does not work either. I also receive error there.
From what I see the integration does not reach the Cloud Connector. The errors appears on the exchange OAuth code.

If you need more information, please share what you need :wink:

The error you get in the app is "viperError":"missing_required_query_parameters" by any chance or it’s another one?
Because there’s a known issue in the latest Android app version (1.8.17.23) where we get this error but you can use iOS or the previous app version.
If it’s another issue in the app, please share with us the error code you get. If there’s no error code, please share the following:

  1. Record your mobile screen replicating the issue
  2. Collect the app logs:
  1. Take note of the time you’re replicating the issue and share it with us including your time zone. Eg. 14:25 GMT-6
  2. Share your connector’s ID. It’s the one that appears in the Developer Workspace as App ID and starts with viper_...

Send the info above to build@smartthings.com.

And just FYI for others that ask, the original reporter in this post didn’t confirm it was solved, he was going to check things on his side because when we asked the team’s help, they saw that in his response when getting the Access Token, he didn’t provide the field refreshToken which is expected.

Hello, i don’t know if this could help. I had a similar problem and resolved by setting the oauth scope as : openid on the developer workspace, device cloud credentials option.

1 Like

Because there’s a known issue in the latest Android app version (1.8.17.23) where we get this error but you can use iOS or the previous app version.

Can I ask what kind of issue?

Hi, @Shina_System_Co_Ltd
I replied in your other post but just as a reference here:
The issue is still under investigation because it wasn’t happening for every partner, perhaps your findings about the scopes being missing in your Developer Workspace config can help us out.