[C2C] Who make AOuth2.0 accessToken and refreshToken?


I need help this step : OAuth Integrations

I wrote ‘Token URI’ to App Details → Device Cloud Credentials.

And I receive packet to ‘Token URI’.

And response to in the following format from request type : grant_type = authorization_code.

“access_token”: accessToken,
“token_type”: “bearer”,
“refresh_token”: refreshToken,
“expires_in”: 3600,
“scope”: “x:devices:* r:devices:*”

I [create] accessToken and refreshToken.
And I returned it like above.

The access token I created was valid for a certain period of time, but after a certain period of time, the access token and refresh token changed and were being sent to the Authorization URI.

(1) I should not make these token? Who make these?

(2) If so how can I get these tokens?

(3) And how can I exchange accesstoken use refreshtoken? Should I recreate accesstoken?
(grant_type = refresh_token)

Please let me know, thanks.

Hi, @notdef14

Are you working with ST Schema? If so, are you using the Node JS SDK?
I just want to clarify this because OAuth Integration refers to another integration type where no Device Cloud Credentials are defined in the Developer Workspace.

The access token allows your cloud to communicate with the SmartThings platform.
In the Schema Connector, the access token is used to send callbacks with status updates or discoveries to ST.

If you’re using the ST Schema NodeJS SDK, you can check the example of the configuration to get access tokens here

Yes, you need to refresh the Access Token if it’s expired

The access token is valid for 24hrs. In ST Schema, the Refresh Token is valid until you delete the integration and the user needs to log in again.

Please, let me know if you have more doubts, we can go step by step, no problem.