Auth code generation?


#1

I have an app that uses Auth code. What is the easiest way to generate the auth code? I know my client id and password. I have a python script that will connect to my hub and update virtual sensors.

Thanks


(Arthur Muradyan) #2

Are you talking about the new or old API?
For the old one here is the link describing the flow of getting the Auth code, token and endpoint Urls:
http://docs.smartthings.com/en/latest/smartapp-web-services-developers-guide/authorization.html
So basically, you have to send the user to https://{{graph}}.api.smartthings.com/oauth/authorize page, have them authorize their location and devices. Pay attention to {{graph}} subdomain, it may be different if your SmartApp is not published yet. Then it will be redirected to your service (to redirect_uri param you specify) which will contain code param.


#3

Thanks I found the auth page and was able to get the code.


(Arthur Muradyan) #4

That’s great edlentz!
Was that the one I mentioned or it was the from a new API?
I am currently researching if the new API has the same web based auth flow, and not able to find one.


#5

I think it was the new API. I need to write some of this stuff down. :)) I accidently found the page. SOme things are hidden from us plain folk