I am using a custom smart app that is a cloud to cloud integration that uses oAuth. Last night the oAuth login stopped working. It now returns a response message of “Unauthorized”. I have confirmed that using a curl command from http://reqbin.com/curl has no problem getting a response with the token info. It would appear that the Smartthings ip range may have been blocked by the oAuth owner. The smartapp is using asynchttp_v1.post to make the oAuth request.
Is there any other explanation for the sudden failure?
Can anyone recommend another way to get the oAuth token? Could I set up a reverse proxy? Would a different method to post the request help?
Update: The smart app started working late last night… I assume the oAuth requests started working again. However, this morning it is not working again. Could the requests sent last night have been using a different IP range?
Is there a way to log what IP address the asynchttp_v1.post is originating from?
Hi there! asynchttp_v1 is a beta feature, so you could experience inconsistencies.
Can you share your SmartApp source code and the error you receive, please? I’d like to know more about it to help you out.
I was able to get the Access Token using my OAuth SmartApp using Node JS in my use case.
I have talked about this situation with our engineering department. Up to now, there have been no changes for asynchttp_v1, so it should be working as usual.
Based on your description, the problem could be related with the rate limits in the third-party cloud (https://mysmartblinds.auth0.com).
This request originates in the Amazon EC2 instances where the SmartApp runs in, if there is a rate limit with the requests number from an IP address, it could cause the rejection.
If your SmartApp will only send commands from SmartThings to the third-party cloud, then, you could migrate your Groovy SmartApp using the SmartApp SDK. This tutorial is a good starting point, and I can help with this process if you share more details about it.