Hello, I’m trying to create an integration where smartthings connects to an azure function I have deployed, and retrieves devices from the database of another app I’m developing. I have done the same for google home and alexa successfully already.
I have created a cloud connector schema for this, and set up an azure ad b2c for the authentication flow. I added the c2c urls to the allowed redirect urls, and on the cloud to cloud project added the Ids, secrets, urls and scope necessary for it to work.
I deployed to test the project, and when I click on it on my smartthings app, it redirects to the login/authorization successfully, I login into my account and it then redirects me to another page with the following URL:
Hi, @Henrique_Gaspar. Welcome to the SmartThings Community!
The Schema integration is used to add devices to the SmartThings platform that are accessible only through the Cloud, but I’m not sure if that’s what you’re trying to achieve, can you confirm, please?
Or, do you want to get an OAuth token to be able to control existing devices from a user? That is a different integration type.
Hello @nayelyz thank you for the quick response and for the welcome!
Yes that’s what I’m trying to achieve. Similar to alexa smart home skill and google home.
For more context, I have a smart home application where I can add smart home devices, these devices are stored in a database. What I want to do is allow for smartthings to interact with them.
To do that from what I understood I need to create a cloud connector, that uses an azure function url I created as a webhook to receive the, for example, discovery calls and retrieve/map the devices from my other application so that I can see the devices on the smartthings app in the smartthings format.
And using the same webhook, I was able to get the smartapp to call my azure function. But I would preffer to leave the handling of OAuth to smartthings instead of me having to code it. That’s why I think the problem is somewhere in the token exchange step
Hi @Henrique_Gaspar
Could you please provide the timestamp of the last test? If you don’t remember, please run the test again. Also, please share the Viper ID with us. You can find it in the Developer Workspace, as well as access to your account.
Confirm the email account registered in the forum is the same one you use for SmartThings. If not, please share it with me over DM
Select the time period and confirm - In this step, please select “Until turned off”, once the team finishes, we’ll let you know so you can disable it again.
The team has reviewed your issue and is asking you to check if your SmartThings app is updated to the latest version from the App Store. Could you please confirm?
Could you please send us a screen recording showing the issue?
Also to analyze the problem, it is important to get app logs. You could help us to reproduce the error and, once you find it, send us the logs.
Go to Menu > Gear Icon > About SmartThings
Tap the SmartThings logo 10 times.
This will open the developer’s space > tap ‘report a problem’
This will send you to the report page. Select a frequency and write a short description of the issue.
Click on “Report” and a log file will be generated for you to send over email, please do to build@smartthings.com
At first, you see me activating a smartapp I created with my azure function as a webhook. When it gives me the error “There was a problem connecting…” I receive a CONFIGURATION call on my Webhook, so I know the webhook is working and can receive http requests.
Then I try to activate my cloud schema, by going to the devices. And as you can see by the video, after I complete the authentication, it gives me an error, but my Webhook doesn’t receive anything, I believe this is where I should receive a “Discovery” request on my webhook.
Thanks for the information.We noticed that the logs were not sent, and the engineering team has requested them to analyze the issue. It is important to replicate the error again to provide updated logs with the full flow.
Additionally, could you clarify the purpose of your SmartApp?