UserInfo - OAuth - how to get it

Hi,
I’m developing SpringBoot application that should authorize using OAuth2 with SmartThings account. I’m getting Authorization Code, Access Token, but unfortunately I’m not able to get any information about user. Is there any possibility to get it like in case of other portals (ex for Google https://www.googleapis.com/oauth2/v3/userinfo with token)?

There is no info about it in documentation :frowning:
Thanks

Tagging @erickv

Hi, @Ratel

The information that you can get from users can be accessed at the SmartThings API (devices, locations, rules, etc.) and you need to fulfill some requirements that you can find at the OAuth Integrations documentation.

Thank you for reply. Currently I belong to some organization(I would like not to write it here) registered in Developer Workspace, so I think that I fulfilled all possible requirements. I’ve got registered SmartApp, I can get Authorization Code, Access Token and using this token (like PAN) to get all information that are described in SmartThings API documentation (devices, locations, rules, execute commands on devices etc.), but I would like also to have information about user for which commands are proceeded. Usually portals like Facebook, Github, Gmail, Imgur, Twitter, linkedin etc that are giving possibility to authorize using OAuth2, are also giving possibility to get information about logged user basing on some URL and Access Token. For example for Google it is:
https://www.googleapis.com/oauth2/v3/userinfo (running it with Access Token as bearer will return information about user)

Is something like that or similar available for OAuth for SmartThings ?

Hi, @Ratel

Unfortunately, at this moment it is not possible to access personal information of authorized SmartThings users through the SmartThings API.

In this instance google is also an identity provider. SmartThings does not provide a user level identity for any device or location in the current API. If your third-party service has it’s own authentication and identity provider, you can associate the token with that user info.

2 Likes

@jody.albritton @erickv
Thanks for replies. I can associate token with the user from my service, but the problem is that token is changing so from my third-party service point of view, there is no sure to which SmartThings account user is logging in this time. I even don’t need users name, email or some other fragile info (to prevent GDPR problems) but it would be useful for me to get some identifier for SmartThings account (eg 12345 to know that user is logged to 12345 account, not to 54321) :confused:

Can you use the location id?

1 Like

@TonyFleisher
I would like to have some id (at least number) to know which location is to which account. Nevertheless without any UserInfo or id, assigning location ids to account from my server seems to be good solution. Thanks.

How was the access-token issued? I have been issued code, but issued not access-token.