SmartThings EndPoint Url Info for OAuth Implementation

Hello,
I want to implement OAuth and get access token from SmartThings Server.
For that I need to know the the endpoint URL of SmartThings to call.

how to add client_id and secret in the auth endpoint url.
So that I get access token and able to call SmartThings API .

I am no longer really active on SmartThings, but suggest you learn how the example project works. It was the direction I used for HubiThings Replica and using the ‘glitch’ workspace gives you the required OAuth redirects.

1 Like

I’ve never actually tried making an OAUTH app, or indeed an API_ONLY app or an API Access app which may or may not be other names for the same thing, I’ve only ever tried simple Webhook SmartApps (using PHP). I can sympathise with your obvious difficulties in getting started. As far as I can see the developer documentation contains absolutely no practical information at all when it comes to the SmartThings side of things. The best you can do is dissect one of the example apps which isn’t necessarily easy if, like me, you find TypeScript/JavaScript code almost completely unreadable and Glitch to be a completely hostile environment.

My best guess is that

https://api.smartthings.com/oauth/authorize?client_id=${clientId}&scope=${scope}&response_type=code&redirect_uri=${redirectUri}

may be the starting point in making the magic happen when it comes to ‘logging in’ to SmartThings.

@orangebucket
Thank you so much for your response.
URL provided by you is working till samsung account login after that there is some problem occurs.

I have created 2 types of project inside - Developer Workspace

  1. CloudConnector Type App
  • we got clientid and clientSecret
  • I used this client id and call via - Samsung account
  • It will redirect to Samsung login page and after login it will give - unauthorized client

  • It will redirect to Samsung login page and after login it will give - unauthorized client
  1. Automation Type App
  • we got clientid and clientSecret
  • I used this client id and call via - Samsung account
  • It will redirect to Samsung login page and after login it will give - - ‘redirect_uri’ could not be validated


redirect_uri i am giving is same like which we give when register app in smartthings project.

Can you please help me what i am doing wrong.
Thanks in advance.

I’d just be taking wild guesses, but I note that the CLI command smartthings app:create walks you through creating an ‘OAuth-In’ app, which seems to be yet another name for what the API refers to as an API_ONLY app. So it might be that in this case you do need to avoid the Developer Workspace in order to create the correct type of app and use either the CLI or the API directly.