So I am trying to create an Android app that can integrate multiple Smart Home apps together for analytics. However the only way to obtain information about people’s devices is through a personal access token. Taking a look at the Samsung Connect app, when you login, you see a screen like this:
I assume that after login, the app returns the user’s personal access token in order to retrieve the list of devices, correct? If this is the case, how can I register my app with this “Login with Samsung” to set up all the app client id, secret, callback url for my app?
So I’ve been given a “private beta access which has a limit of 20 installs” while my application is still being approved. In the smartthings docs, it says this:
A user first taps on a “My SmartThings” icon in your application. Your application must then redirect the user to the SmartThings accounts server by calling an OAuth endpoint.
You can exchange this code for an access token in a subsequent POST request to SmartThings.
What is the OAuth endpoint supposed to be? And what is the endpoint that make a POST request to after receiving a code?
Everything else is just an API call to our standard documented APIs. You take the token and refresh token for each user and use those to access the API.
@jody.albritton
I believe I’ve already been given access after filling out the request form as I can see this in the developer workspace. However, I didn’t get a link to the “full” documentation that you’re talking about.
However, after I logged in my Samsung account, it immediately went to the redirect url, and I got a result of https://example.com/?error=invalid_request. No code was returned. What went wrong?
@jody.albritton
I tried using a custom intent filter for android with the url: “https://www.loginactivity.com/login”. However, when I ran the example again, I still get the following query param, “?error=invalid_request”. I registered this redirect url in the developer workspace. So how can I fix this?
My guess is that there is still something wrong with your redirect uris. On your side you need to have the available redirecturi. If you look at the flow, it’s basically bundling up your request and sending it to Samsung Accounts. If the login is successful, it tries to send the registration info back to whatever uri you specified.